My favorites
▼
|
Sign in
kcode
Sample code projects
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
billpayevolution
/
billpay
/
Refactoring2AbstractComponents
/
src
/
com
/
extensiblejava
/
bill
/
Bill.java
r109
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.extensiblejava.bill;
import com.extensiblejava.audit.*;
import com.extensiblejava.financial.*;
import java.math.*;
import com.extensiblejava.bill.data.*;
public class Bill {
private BillDataBean billData;
public static Bill loadBill(BillEntityLoader loader) {
return loader.loadBill();
}
public Bill(BillDataBean billData) {
this.billData = billData;
}
public String getBillId() { return this.billData.getBillId().toString(); }
public String getName() { return this.billData.getName(); }
public BigDecimal getAmount() { return this.billData.getAmount(); }
public BigDecimal getAuditedAmount() { return (this.billData.getAuditedAmount() == null ? null : this.billData.getAuditedAmount()); }
public BigDecimal getPaidAmount() { return this.billData.getPaidAmount(); }
public String getStatus() {
if (this.billData.getPaidAmount() != null) {
return "PAID";
} else if (this.billData.getAuditedAmount() != null) {
return "AUDITED";
} else {
return "NEW";
}
}
public void audit(AuditFacade auditor) {
this.billData.setAuditedAmount(auditor.audit(this));
this.persist();
}
public void pay() {
if (this.billData.getPaidAmount() == null) {
Payment payer = new Payment();
this.billData.setPaidAmount(payer.generateDraft(this));
this.persist();
}
}
private void persist() {
BillDb.update(billData);
}
}
Show details
Hide details
Change log
r69
by pragkirk on Nov 5, 2009
Diff
Initial Version
Go to:
...y/Refactoring2AbstractComponents
...oring2AbstractComponents/WEB-INF
...stractComponents/WEB-INF/app.tld
...g2AbstractComponents/WEB-INF/lib
...ents/WEB-INF/lib/servlet-api.jar
...omponents/WEB-INF/lib/struts.jar
...mponents/WEB-INF/struts-bean.tld
...onents/WEB-INF/struts-config.xml
...mponents/WEB-INF/struts-form.tld
...mponents/WEB-INF/struts-html.tld
...ponents/WEB-INF/struts-logic.tld
...ents/WEB-INF/struts-template.tld
...actComponents/WEB-INF/struts.tld
...stractComponents/WEB-INF/web.xml
...ing2AbstractComponents/build.xml
...ing2AbstractComponents/clean.bat
...oring2AbstractComponents/cmd.bat
...factoring2AbstractComponents/jsp
...actComponents/jsp/BillDetail.jsp
...Components/jsp/CustomerBills.jsp
...bstractComponents/jsp/search.jsp
...factoring2AbstractComponents/src
...oring2AbstractComponents/src/com
...omponents/src/com/extensiblejava
...nts/src/com/extensiblejava/audit
...siblejava/audit/AuditFacade.java
...iblejava/audit/AuditFacade1.java
...ents/src/com/extensiblejava/bill
...om/extensiblejava/bill/Bill.java
...ejava/bill/BillEntityLoader.java
...xtensiblejava/bill/Customer.java
...a/bill/CustomerEntityLoader.java
...ill/DefaultBillEntityLoader.java
...DefaultCustomerEntityLoader.java
...siblejava/bill/EntityLoader.java
...om/extensiblejava/bill/Name.java
...src/com/extensiblejava/bill/data
...java/bill/data/BillDataBean.java
...nsiblejava/bill/data/BillDb.java
.../bill/data/CustomerDataBean.java
...src/com/extensiblejava/financial
...siblejava/financial/Payment.java
...onents/src/com/extensiblejava/ui
...tensiblejava/ui/AuditAction.java
...blejava/ui/BillDetailAction.java
...siblejava/ui/BillDetailForm.java
...ava/ui/CustomerSearchAction.java
...ejava/ui/CustomerSearchForm.java
...i/CustomerSearchResultsBean.java
...extensiblejava/ui/PayAction.java
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1418 bytes, 50 lines
View raw file
Powered by
Google Project Hosting