private JPanel buildSearchForm() {
    JPanel panel = new JPanel();
    panel.setLayout(
        new MigLayout("", "[][]30[][]30[]", "[]20[]")); // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    JLabel nameLabel = new JLabel(Messages.getString("MenuItemExplorer.0")); // $NON-NLS-1$
    JLabel groupLabel = new JLabel(Messages.getString("MenuItemExplorer.1")); // $NON-NLS-1$
    final JTextField nameField = new JTextField(15);

    try {

      List<MenuGroup> menuGroupList = MenuGroupDAO.getInstance().findAll();

      final JComboBox cbGroup = new JComboBox();

      cbGroup.addItem(Messages.getString("MenuItemExplorer.2")); // $NON-NLS-1$
      for (MenuGroup s : menuGroupList) {
        cbGroup.addItem(s);
      }

      JButton searchBttn = new JButton(Messages.getString("MenuItemExplorer.3")); // $NON-NLS-1$

      panel.add(nameLabel, "align label"); // $NON-NLS-1$
      panel.add(nameField);
      panel.add(groupLabel);
      panel.add(cbGroup);
      panel.add(searchBttn);

      Border loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
      TitledBorder title = BorderFactory.createTitledBorder(loweredetched, "Search"); // $NON-NLS-1$
      title.setTitleJustification(TitledBorder.LEFT);
      panel.setBorder(title);

      searchBttn.addActionListener(
          new ActionListener() {

            public void actionPerformed(ActionEvent e) {

              String txName = nameField.getText();
              Object selectedItem = cbGroup.getSelectedItem();

              List<MenuItem> similarItem = null;
              if (selectedItem instanceof MenuGroup) {
                similarItem =
                    MenuItemDAO.getInstance().getSimilar(txName, (MenuGroup) selectedItem);
              } else {
                similarItem = MenuItemDAO.getInstance().getSimilar(txName, null);
              }

              tableModel.removeAll();
              tableModel.addRows(similarItem);
            }
          });

    } catch (Throwable x) {
      BOMessageDialog.showError(POSConstants.ERROR_MESSAGE, x);
    }

    return panel;
  }
  public void actionPerformed(ActionEvent e) {
    note.requestFocus();

    String s = e.getActionCommand();
    if (s.equals(com.floreantpos.POSConstants.OK)) {
      // canceled = false;
      // dispose();
    } else if (s.equals(com.floreantpos.POSConstants.CANCEL)) {
      // canceled = true;
      // dispose();
    } else if (s.equals(com.floreantpos.POSConstants.CLEAR)) {
      String str = note.getText();
      if (str.length() > 0) {
        str = str.substring(0, str.length() - 1);
      }
      note.setText(str);
    } else if (s.equals(com.floreantpos.POSConstants.CLEAR_ALL)) {
      note.setText(""); // $NON-NLS-1$
    } else if (s.equals(Messages.getString("NoteView.43"))) { // $NON-NLS-1$
      String str = note.getText();
      if (str == null) {
        str = ""; // $NON-NLS-1$
      }
      note.setText(str + " "); // $NON-NLS-1$
    } else {
      String str = note.getText();
      if (str == null) {
        str = ""; // $NON-NLS-1$
      }
      note.setText(str + s);
    }
  }
  public NoteView() {
    setLayout(new BorderLayout(5, 5));

    // note.setFont(note.getFont().deriveFont(Font.BOLD, 18));
    note.setWrapStyleWord(true);
    note.setLineWrap(true);
    note.setDocument(new FixedLengthDocument(255));

    TransparentPanel northPanel = new TransparentPanel(new BorderLayout());
    JScrollPane scrollPane = new JScrollPane(note);
    northPanel.setPreferredSize(new Dimension(100, 60));
    northPanel.add(scrollPane);
    add(northPanel, BorderLayout.NORTH);

    TransparentPanel centerPanel = new TransparentPanel(new GridLayout(0, 1, 2, 2));
    centerPanel.add(addButtonsToPanel(s1));
    centerPanel.add(addButtonsToPanel(s2));
    centerPanel.add(addButtonsToPanel(s3));
    centerPanel.add(addButtonsToPanel(s4));
    add(centerPanel, BorderLayout.CENTER);

    JPanel eastPanel = new JPanel(new GridLayout(0, 1, 2, 2));
    PosButton button = new PosButton();
    button.setText(Messages.getString("NoteView.40")); // $NON-NLS-1$
    button.addActionListener(this);
    eastPanel.add(button);

    POSToggleButton toggleButton = new POSToggleButton();
    toggleButton.setText(Messages.getString("NoteView.41")); // $NON-NLS-1$
    toggleButton.addChangeListener(this);
    eastPanel.add(toggleButton);

    button = new PosButton();
    button.setText(com.floreantpos.POSConstants.CLEAR);
    button.addActionListener(this);
    eastPanel.add(button);

    button = new PosButton();
    button.setText(com.floreantpos.POSConstants.CLEAR_ALL);
    button.addActionListener(this);
    eastPanel.add(button);

    eastPanel.setPreferredSize(new Dimension(90, 50));
    add(eastPanel, BorderLayout.EAST);
  }
Beispiel #4
0
  public KitchenDisplayWindow() {
    setTitle(Messages.getString("KitchenDisplayWindow.0")); // $NON-NLS-1$
    setIconImage(Application.getApplicationIcon().getImage());

    add(view);

    setSize(Toolkit.getDefaultToolkit().getScreenSize());
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  }
public class DrawerAssignedHistory extends BaseDrawerAssignedHistory {
  private static final long serialVersionUID = 1L;

  /*[CONSTRUCTOR MARKER BEGIN]*/
  public DrawerAssignedHistory() {
    super();
  }

  /** Constructor for primary key */
  public DrawerAssignedHistory(java.lang.Integer id) {
    super(id);
  }

  /*[CONSTRUCTOR MARKER END]*/

  public static final String ASSIGNMENT_OPERATION =
      Messages.getString("DrawerAssignedHistory.0"); // $NON-NLS-1$
  public static final String CLOSE_OPERATION =
      Messages.getString("DrawerAssignedHistory.1"); // $NON-NLS-1$
}
  public TicketDiscount getSelectedCoupon() {
    try {

      double parseDouble = NumberUtil.parse(tfValue.getText()).doubleValue();
      ticketCoupon.setValue(parseDouble);

    } catch (Exception x) {
      throw new PosException(Messages.getString("CouponAndDiscountDialog.27")); // $NON-NLS-1$
    }
    return ticketCoupon;
  }
  private void doEnterValue(java.awt.event.ActionEvent evt) { // GEN-FIRST:event_doEnterValue
    NumberSelectionDialog2 dialog = new NumberSelectionDialog2();
    dialog.setFloatingPoint(true);
    dialog.setTitle(Messages.getString("CouponAndDiscountDialog.28")); // $NON-NLS-1$
    dialog.pack();
    dialog.open();

    if (!dialog.isCanceled()) {
      double value = dialog.getValue();
      tfValue.setText(NumberUtil.formatNumber(value));
    }
  } // GEN-LAST:event_doEnterValue
 private void doOk(java.awt.event.ActionEvent evt) { // GEN-FIRST:event_doOk
   try {
     TicketDiscount selectedCoupon = getSelectedCoupon();
     if (selectedCoupon == null) {
       POSMessageDialog.showError(
           this, Messages.getString("CouponAndDiscountDialog.29")); // $NON-NLS-1$
       return;
     }
     setCanceled(false);
     dispose();
   } catch (PosException e) {
     POSMessageDialog.showError(this, e.getMessage());
   }
 } // GEN-LAST:event_doOk
  private void viewReport() throws Exception {
    Date fromDate = fromDatePicker.getDate();
    Date toDate = toDatePicker.getDate();

    if (fromDate.after(toDate)) {
      POSMessageDialog.showError(
          BackOfficeWindow.getInstance(),
          com.floreantpos.POSConstants.FROM_DATE_CANNOT_BE_GREATER_THAN_TO_DATE_);
      return;
    }

    fromDate = DateUtil.startOfDay(fromDate);
    toDate = DateUtil.endOfDay(toDate);

    ReportService reportService = new ReportService();
    CreditCardReport report = reportService.getCreditCardReport(fromDate, toDate);

    HashMap<String, Object> map = new HashMap<String, Object>();
    ReportUtil.populateRestaurantProperties(map);
    map.put(
        "reportTitle",
        "========= " + Messages.getString("PosMessage.142").toUpperCase() + " ==========");
    map.put("fromDate", ReportService.formatShortDate(fromDate));
    map.put("toDate", ReportService.formatShortDate(toDate));
    map.put("reportTime", ReportService.formatFullDate(new Date()));

    map.put("salesCount", String.valueOf(report.getTotalSalesCount()));
    map.put("totalSales", NumberUtil.formatNumber(report.getTotalSales()));
    map.put("netTips", NumberUtil.formatNumber(report.getNetTips()));
    map.put("netTipsPaid", NumberUtil.formatNumber(report.getTipsPaid()));
    map.put("netCharge", NumberUtil.formatNumber(report.getNetCharge()));

    JasperReport jasperReport =
        (JasperReport)
            JRLoader.loadObject(
                getClass().getResource("/com/floreantpos/ui/report/credit_card_report.jasper"));
    JasperPrint jasperPrint =
        JasperFillManager.fillReport(
            jasperReport, map, new JRTableModelDataSource(report.getTableModel()));
    JRViewer viewer = new JRViewer(jasperPrint);
    reportContainer.removeAll();
    reportContainer.add(viewer);
    reportContainer.revalidate();
  }
Beispiel #10
0
  @Override
  public void preAuth(PosTransaction transaction) throws Exception {
    Ticket ticket = transaction.getTicket();

    if (ticket.getOrderType().name() == OrderType.BAR_TAB
        && ticket.hasProperty("AcqRefData")) { // $NON-NLS-1$ //fix
      captureAuthAmount(transaction);
      return;
    }

    String mpsResponse = doPreAuth(ticket, transaction.getCardTrack(), transaction.getAmount());

    MercuryResponse result = new MercuryResponse(mpsResponse);
    if (!result.isApproved()) {
      throw new PosException(Messages.getString("MercuryPayProcessor.13")); // $NON-NLS-1$
    }

    System.out.println(mpsResponse);

    transaction.setCardTransactionId(result.getTransactionId());
    transaction.setCardAuthCode(result.getAuthCode());
    transaction.addProperty("AcqRefData", result.getAcqRefData()); // $NON-NLS-1$
  }
  @Override
  public void refresh() throws Exception {
    // Date date1 = DateUtils.startOfDay(getStartDate());
    // Date date2 = DateUtils.endOfDay(getEndDate());

    List<Ticket> tickets = TicketDAO.getInstance().findOpenTickets();
    TicketReportModel reportModel = new TicketReportModel();
    reportModel.setItems(tickets);

    HashMap map = new HashMap();
    ReportUtil.populateRestaurantProperties(map);
    map.put(
        "reportTitle",
        Messages.getString("OpenTicketSummaryReport.0")); // $NON-NLS-1$ //$NON-NLS-2$
    map.put("reportTime", ReportService.formatFullDate(new Date())); // $NON-NLS-1$
    // map.put("dateRange", Application.formatDate(date1) + " to " + Application.formatDate(date2));
    map.put("terminalName", com.floreantpos.POSConstants.ALL); // $NON-NLS-1$

    JasperReport masterReport = ReportUtil.getReport("open_ticket_summary_report"); // $NON-NLS-1$
    JasperPrint print =
        JasperFillManager.fillReport(masterReport, map, new JRTableModelDataSource(reportModel));
    viewer = new JRViewer(print);
  }
  // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
  private void initComponents() {
    reportConstraintPanel = new com.floreantpos.swing.TransparentPanel();
    jLabel1 = new javax.swing.JLabel();
    cbReportType = new javax.swing.JComboBox();
    jLabel2 = new javax.swing.JLabel();
    dpStartDate = UiUtil.getCurrentMonthStart();
    dpEndDate = UiUtil.getCurrentMonthEnd();
    jLabel3 = new javax.swing.JLabel();
    btnRefresh = new javax.swing.JButton();
    reportPanel = new com.floreantpos.swing.TransparentPanel();

    setLayout(new java.awt.BorderLayout(5, 5));

    jLabel1.setText(Messages.getString("ReportViewer.0") + ":"); // $NON-NLS-1$ //$NON-NLS-2$

    cbReportType.setModel(
        new javax.swing.DefaultComboBoxModel(
            new String[] {
              com.floreantpos.POSConstants.PREVIOUS_SALE_AFTER_DRAWER_RESET_,
              com.floreantpos.POSConstants.SALE_BEFORE_DRAWER_RESET
            }));

    jLabel2.setText(com.floreantpos.POSConstants.START_DATE + ":"); // $NON-NLS-1$

    jLabel3.setText(com.floreantpos.POSConstants.END_DATE + ":"); // $NON-NLS-1$

    btnRefresh.setText(com.floreantpos.POSConstants.REFRESH);
    btnRefresh.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            doRefreshReport(evt);
          }
        });

    org.jdesktop.layout.GroupLayout reportConstraintPanelLayout =
        new org.jdesktop.layout.GroupLayout(reportConstraintPanel);
    reportConstraintPanel.setLayout(reportConstraintPanelLayout);
    reportConstraintPanelLayout.setHorizontalGroup(
        reportConstraintPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                reportConstraintPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        reportConstraintPanelLayout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                reportConstraintPanelLayout
                                    .createSequentialGroup()
                                    .add(
                                        reportConstraintPanelLayout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(jLabel2)
                                            .add(jLabel1))
                                    .add(15, 15, 15)
                                    .add(
                                        reportConstraintPanelLayout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING, false)
                                            .add(
                                                cbReportType,
                                                0,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .add(
                                                dpStartDate,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(jLabel3)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        dpEndDate,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, btnRefresh))
                    .addContainerGap()));
    reportConstraintPanelLayout.setVerticalGroup(
        reportConstraintPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                reportConstraintPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        reportConstraintPanelLayout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel1)
                            .add(
                                cbReportType,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        reportConstraintPanelLayout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                dpEndDate,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel3)
                            .add(
                                reportConstraintPanelLayout
                                    .createSequentialGroup()
                                    .add(
                                        reportConstraintPanelLayout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(
                                                dpStartDate,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(jLabel2))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(btnRefresh)))
                    .addContainerGap(
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    reportConstraintPanelLayout.linkSize(
        new java.awt.Component[] {dpEndDate, dpStartDate, jLabel2, jLabel3},
        org.jdesktop.layout.GroupLayout.VERTICAL);

    add(reportConstraintPanel, java.awt.BorderLayout.NORTH);

    reportPanel.setLayout(new java.awt.BorderLayout());

    add(reportPanel, java.awt.BorderLayout.CENTER);
  } // </editor-fold>//GEN-END:initComponents
Beispiel #13
0
  public KitchenDisplayView(boolean showHeader) {
    setLayout(new BorderLayout(5, 5));
    PosPrinters printers = Application.getPrinters();
    List<Printer> kitchenPrinters = printers.getKitchenPrinters();
    DefaultComboBoxModel<Printer> printerModel = new DefaultComboBoxModel<Printer>();
    printerModel.addElement(null);
    for (Printer printer : kitchenPrinters) {
      printerModel.addElement(printer);
    }

    Font font = getFont().deriveFont(18f);

    cbPrinters.setFont(font);
    cbPrinters.setRenderer(new PosComboRenderer());
    cbPrinters.setModel(printerModel);
    cbPrinters.addActionListener(this);

    JPanel firstTopPanel = new JPanel(new BorderLayout(5, 5));
    if (showHeader) {
      headerPanel = new HeaderPanel();
      firstTopPanel.add(headerPanel, BorderLayout.NORTH);
    }

    filterPanel = new JPanel();

    PosButton btnBack = new PosButton("Back");
    btnBack.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            RootView.getInstance().showDefaultView();
          }
        });

    JLabel label = new JLabel(Messages.getString("KitchenDisplayView.5")); // $NON-NLS-1$
    label.setFont(font);

    JLabel label2 = new JLabel(Messages.getString("KitchenDisplayView.6")); // $NON-NLS-1$
    label2.setFont(font);

    filterPanel.setLayout(new MigLayout("", "[][][][][fill,grow][]", ""));
    filterPanel.add(label);
    filterPanel.add(cbPrinters);

    filterPanel.add(label2);
    filterPanel.add(cbTicketTypes);

    btnFilter = new PosButton("Filter");
    btnFilter.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            KitchenFilterDialog dialog = new KitchenFilterDialog();
            dialog.add(filterPanel, BorderLayout.CENTER);
            dialog.open();
          }
        });

    JPanel topPanel =
        new JPanel(
            new MigLayout(
                "fill, ins 2 2 0 2",
                "[][fill, grow][]",
                "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    // topPanel.setBorder(BorderFactory.createTitledBorder("Filter: All Printers- All Orders"));
    // //$NON-NLS-1$

    // topPanel.add(label);
    // topPanel.add(cbPrinters);

    Dimension size = PosUIManager.getSize(60, 40);

    Font filterFont = getFont().deriveFont(Font.BOLD, 12f);
    lblFilter = new JLabel("Filter: All Printers- All Orders"); // $NON-NLS-1$
    lblFilter.setForeground(new Color(49, 106, 196));
    lblFilter.setFont(filterFont);
    topPanel.add(lblFilter);
    topPanel.add(btnFilter, "w " + size.width + "!,h " + size.height + "!");
    topPanel.add(btnBack, "w " + size.width + "!, h " + size.height + "!");
    topPanel.setBackground(Color.white);

    cbTicketTypes.setFont(font);
    cbTicketTypes.setRenderer(new PosComboRenderer());
    DefaultComboBoxModel<OrderType> ticketTypeModel = new DefaultComboBoxModel<OrderType>();
    for (OrderType orderType : Application.getInstance().getOrderTypes()) {
      ticketTypeModel.addElement(orderType);
    }
    ticketTypeModel.insertElementAt(null, 0);
    cbTicketTypes.setModel(ticketTypeModel);
    cbTicketTypes.setSelectedIndex(0);
    cbTicketTypes.addActionListener(this);

    // topPanel.add(label2);
    // topPanel.add(cbTicketTypes);

    btnLogout = new PosButton(new LogoutAction(true, false)); // $NON-NLS-1$
    // btnLogout.addActionListener(this);
    topPanel.add(btnLogout, "w " + size.width + "!, h " + size.height + "!, wrap");

    topPanel.add(new JSeparator(), "grow,span");

    firstTopPanel.setPreferredSize(new Dimension(0, PosUIManager.getSize(50)));
    firstTopPanel.add(topPanel);
    add(firstTopPanel, BorderLayout.NORTH);

    ticketPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    // JScrollPane scrollPane = new JScrollPane(ticketPanel);
    // scrollPane.getHorizontalScrollBar().setSize(new Dimension(100, 60));
    // scrollPane.getHorizontalScrollBar().setPreferredSize(new Dimension(100, 60));
    add(ticketPanel);

    add(ticketPanel.getPaginationPanel(), BorderLayout.SOUTH);

    viewUpdateTimer = new Timer(5 * 1000, this);
    viewUpdateTimer.setRepeats(true);
  }
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    titlePanel1 = new com.floreantpos.ui.TitlePanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    listCoupons = new javax.swing.JList();
    btnCancel = new com.floreantpos.swing.PosButton();
    btnOk = new com.floreantpos.swing.PosButton();
    jSeparator1 = new javax.swing.JSeparator();
    btnUp = new com.floreantpos.swing.PosButton();
    btnDown = new com.floreantpos.swing.PosButton();
    jSeparator2 = new javax.swing.JSeparator();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    tfName = new javax.swing.JTextField();
    tfNumber = new javax.swing.JTextField();
    tfType = new javax.swing.JTextField();
    tfValue = new javax.swing.JTextField();
    btnEditValue = new javax.swing.JButton();
    jSeparator3 = new javax.swing.JSeparator();
    jLabel5 = new javax.swing.JLabel();
    lblTotalDiscount = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    titlePanel1.setTitle(Messages.getString("CouponAndDiscountDialog.3")); // $NON-NLS-1$

    jScrollPane1.setViewportView(listCoupons);

    btnCancel.setIcon(
        IconFactory.getIcon("/ui_icons/", "cancel.png")); // NOI18N //$NON-NLS-1$ //$NON-NLS-2$
    btnCancel.setText(Messages.getString("CouponAndDiscountDialog.6")); // $NON-NLS-1$
    btnCancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            doCancel(evt);
          }
        });

    btnOk.setIcon(
        IconFactory.getIcon("/ui_icons/", "finish.png")); // NOI18N //$NON-NLS-1$ //$NON-NLS-2$
    btnOk.setText(Messages.getString("CouponAndDiscountDialog.9")); // $NON-NLS-1$
    btnOk.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            doOk(evt);
          }
        });

    btnUp.setIcon(
        IconFactory.getIcon("/ui_icons/", "up.png")); // NOI18N //$NON-NLS-1$ //$NON-NLS-2$

    btnDown.setIcon(
        IconFactory.getIcon("/ui_icons/", "down.png")); // NOI18N //$NON-NLS-1$ //$NON-NLS-2$

    jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

    jLabel1.setText(
        Messages.getString("CouponAndDiscountDialog.14") + ":"); // $NON-NLS-1$ //$NON-NLS-2$

    jLabel2.setText(
        Messages.getString("CouponAndDiscountDialog.16") + ":"); // $NON-NLS-1$ //$NON-NLS-2$

    jLabel3.setText(
        Messages.getString("CouponAndDiscountDialog.18") + ":"); // $NON-NLS-1$ //$NON-NLS-2$

    jLabel4.setText(
        Messages.getString("CouponAndDiscountDialog.20") + ":"); // $NON-NLS-1$ //$NON-NLS-2$

    tfName.setEditable(false);

    tfNumber.setEditable(false);

    tfType.setEditable(false);

    tfValue.setEditable(false);

    btnEditValue.setText(Messages.getString("CouponAndDiscountDialog.22")); // $NON-NLS-1$
    btnEditValue.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            doEnterValue(evt);
          }
        });

    jLabel5.setFont(new java.awt.Font("Tahoma", 1, 18)); // $NON-NLS-1$
    jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel5.setText(Messages.getString("CouponAndDiscountDialog.24")); // $NON-NLS-1$

    lblTotalDiscount.setFont(new java.awt.Font("Tahoma", 1, 18)); // $NON-NLS-1$
    lblTotalDiscount.setForeground(new java.awt.Color(204, 51, 0));
    lblTotalDiscount.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jSeparator1,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                642,
                                Short.MAX_VALUE)
                            .add(
                                titlePanel1,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                642,
                                Short.MAX_VALUE)
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .add(
                                        jScrollPane1,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        216,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(
                                                btnUp,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(
                                                btnDown,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jSeparator2,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(
                                                org.jdesktop.layout.GroupLayout.TRAILING,
                                                layout
                                                    .createSequentialGroup()
                                                    .addPreferredGap(
                                                        org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(
                                                        btnOk,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE,
                                                        114,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(
                                                        btnCancel,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE,
                                                        117,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE))
                                            .add(
                                                layout
                                                    .createSequentialGroup()
                                                    .add(17, 17, 17)
                                                    .add(
                                                        layout
                                                            .createParallelGroup(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .LEADING)
                                                            .add(jLabel4)
                                                            .add(jLabel3)
                                                            .add(jLabel2)
                                                            .add(jLabel1))
                                                    .addPreferredGap(
                                                        org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(
                                                        layout
                                                            .createParallelGroup(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .LEADING)
                                                            .add(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .add(
                                                                        tfValue,
                                                                        org.jdesktop.layout
                                                                            .GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        130,
                                                                        Short.MAX_VALUE)
                                                                    .addPreferredGap(
                                                                        org.jdesktop.layout
                                                                            .LayoutStyle.RELATED)
                                                                    .add(btnEditValue))
                                                            .add(
                                                                tfType,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                225,
                                                                Short.MAX_VALUE)
                                                            .add(
                                                                tfNumber,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                225,
                                                                Short.MAX_VALUE)
                                                            .add(
                                                                tfName,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                225,
                                                                Short.MAX_VALUE)))
                                            .add(
                                                layout
                                                    .createSequentialGroup()
                                                    .add(18, 18, 18)
                                                    .add(
                                                        layout
                                                            .createParallelGroup(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .LEADING)
                                                            .add(
                                                                jLabel5,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                354,
                                                                Short.MAX_VALUE)
                                                            .add(
                                                                jSeparator3,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                354,
                                                                Short.MAX_VALUE)
                                                            .add(
                                                                lblTotalDiscount,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                354,
                                                                Short.MAX_VALUE))))))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        titlePanel1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jScrollPane1,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                323,
                                Short.MAX_VALUE)
                            .add(
                                jSeparator2,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                323,
                                Short.MAX_VALUE)
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(jLabel1)
                                            .add(
                                                tfName,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(jLabel2)
                                            .add(
                                                tfNumber,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(jLabel3)
                                            .add(
                                                tfType,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(jLabel4)
                                            .add(btnEditValue)
                                            .add(
                                                tfValue,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jSeparator3,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        10,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(
                                                layout
                                                    .createSequentialGroup()
                                                    .add(5, 5, 5)
                                                    .add(
                                                        btnUp,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE,
                                                        org.jdesktop.layout.GroupLayout
                                                            .DEFAULT_SIZE,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(
                                                        btnDown,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE,
                                                        org.jdesktop.layout.GroupLayout
                                                            .DEFAULT_SIZE,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE))
                                            .add(
                                                layout
                                                    .createSequentialGroup()
                                                    .addPreferredGap(
                                                        org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(jLabel5)
                                                    .addPreferredGap(
                                                        org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(lblTotalDiscount)))))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jSeparator1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        10,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(
                                btnCancel,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                btnOk,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    pack();
  } // </editor-fold>//GEN-END:initComponents