}
}
protected void doBtnPrintBillActionPerformed(ActionEvent e) {
try {
Bill bill = new Bill();
bill.setBillDate(new Date());
bill.setCustomer((Customer) PropertyUtils.getProperty(dbObject,
"customer"));
bill.setName("Bill for customer : " + bill.getCustomer());
TemplateTableModel model = (TemplateTableModel) tableServices
.getModel();
SQLMapHolder.sqlMap.startTransaction();
SQLMapHolder.sqlMap.insert("insertBill", bill);
for (DBObject serv : model.getDbObjects()) {
CustomerService service = (CustomerService) serv;
BillItem billItem = new BillItem();
billItem.setBill(bill);
billItem.setQuantity(1);
billItem.setPrice(service.getTotalCost());
billItem.setItem(service.getService().getItem());
bill.getBillItems().add(billItem);
SQLMapHolder.sqlMap.insert("insertBillItem", billItem);
}
SQLMapHolder.sqlMap.commitTransaction();
Map params = new HashMap(1);
params.put("BILL", bill);