private void calculateTotal() { BigDecimal total = BigDecimal.ZERO; for (PenjualanDetail d : penjualanDetails) { total = total.add(d.getSubTotal()); } txtTotal.setText(TextComponentUtils.formatNumber(total)); }
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()); }
/** 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); }
private void loadFormToDomain() { penjualan.setTanggal(jdcTanggal.getDate()); penjualan.setTotal(TextComponentUtils.parseNumberToBigDecimal(txtTotal.getText())); penjualan.setDetails(penjualanDetails); }