Esempio n. 1
0
 private void calculateTotal() {
   BigDecimal total = BigDecimal.ZERO;
   for (PenjualanDetail d : penjualanDetails) {
     total = total.add(d.getSubTotal());
   }
   txtTotal.setText(TextComponentUtils.formatNumber(total));
 }
Esempio n. 2
0
 private void loadDomainToForm() {
   jdcTanggal.setDate(penjualan.getTanggal());
   txtId.setText(penjualan.getId().toString());
   txtTotal.setText(TextComponentUtils.formatNumber(penjualan.getTotal()));
   penjualanDetails = penjualan.getDetails();
   tblPenjualanDetail.setModel(new PenjualanDetailTableModel());
 }
Esempio n. 3
0
  /** Creates new form PenjualanPanel */
  public PenjualanPanel() {
    initComponents();
    initListeners();
    enableForm(false);

    tblPenjualanDetail.setAutoCreateColumnsFromModel(false);
    tblPenjualanDetail
        .getSelectionModel()
        .addListSelectionListener(new PenjualanDetailSelectionListener());
    tblPenjualanDetail.setDefaultRenderer(Object.class, new POSTableCellRenderer());

    TextComponentUtils.setCurrency(txtTotal);
  }
Esempio n. 4
0
 private void loadFormToDomain() {
   penjualan.setTanggal(jdcTanggal.getDate());
   penjualan.setTotal(TextComponentUtils.parseNumberToBigDecimal(txtTotal.getText()));
   penjualan.setDetails(penjualanDetails);
 }