Package org.cesilko.rachota.gui
Class InvoiceGenerator
- java.lang.Object
-
- org.cesilko.rachota.gui.InvoiceGenerator
-
class InvoiceGenerator extends java.lang.ObjectHelper class for generation of HTML/TXT invoices.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classInvoiceGenerator.ProjectRowComparable object representing one project in the summary on invoice.(package private) classInvoiceGenerator.TaskRowComparable object representing one task in the summary on invoice.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcurrencyprivate java.lang.StringcustomerDetailsprivate java.util.Vectordaysprivate java.lang.IntegerdueDaysprivate java.io.Filefileprivate java.lang.StringpaymentDetailsprivate java.lang.Doublepriceprivate java.lang.StringrowsRepresentprivate java.util.VectorselectFiltersprivate java.lang.Doubletaxprivate java.lang.Stringtitleprivate java.lang.StringuserDetails
-
Constructor Summary
Constructors Constructor Description InvoiceGenerator(java.io.File outputFile, java.lang.String title, java.lang.String userDetails, java.lang.String customerDetails, java.lang.String paymentDetails, java.lang.Integer dueDays, java.lang.Double price, java.lang.String currency, java.lang.Double tax, java.lang.String rowsRepresent, java.util.Vector days, java.util.Vector selectFilters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.VectorfilterTasks(java.util.Vector tasks)Filters given vector of tasks trough all used filters and returns vector of tasks satisfying all filters.(package private) voidgenerateInvoice()Generates invoice based on data provided in constructor of InvoiceGenerator class.private InvoiceGenerator.ProjectRow[]getProjectRows()Processes all days in selected period and their tasks and for each non-idle, non-private (unless required) task calculates projects statistic (@see ProjectRow).private InvoiceGenerator.TaskRow[]getTaskRows()Processes all days in selected period and their tasks and for each non-idle, non-private (unless required) task calculates its statistic (@see TaskRow).private voidwriteFooter(java.io.OutputStreamWriter writer)private voidwriteHeader(java.io.OutputStreamWriter writer)private voidwriteHTMLFooter(java.io.OutputStreamWriter writer)private voidwriteHTMLHeader(java.io.OutputStreamWriter writer)private voidwriteHTMLPaymentDetails(java.io.OutputStreamWriter writer)private voidwriteHTMLProjectsTasks(java.io.OutputStreamWriter writer)private voidwriteHTMLSubjects(java.io.OutputStreamWriter writer)private voidwriteHTMLTasks(java.io.OutputStreamWriter writer)private voidwritePaymentDetails(java.io.OutputStreamWriter writer)private voidwriteProjectsTasks(java.io.OutputStreamWriter writer)private voidwriteSubjects(java.io.OutputStreamWriter writer)private voidwriteTasks(java.io.OutputStreamWriter writer)private voidwriteTXTFooter(java.io.OutputStreamWriter writer)private voidwriteTXTHeader(java.io.OutputStreamWriter writer)private voidwriteTXTPaymentDetails(java.io.OutputStreamWriter writer)private voidwriteTXTProjectsTasks(java.io.OutputStreamWriter writer)private voidwriteTXTSubjects(java.io.OutputStreamWriter writer)private voidwriteTXTTasks(java.io.OutputStreamWriter writer)
-
-
-
Field Detail
-
file
private java.io.File file
-
title
private java.lang.String title
-
userDetails
private java.lang.String userDetails
-
customerDetails
private java.lang.String customerDetails
-
paymentDetails
private java.lang.String paymentDetails
-
dueDays
private java.lang.Integer dueDays
-
price
private java.lang.Double price
-
currency
private java.lang.String currency
-
tax
private java.lang.Double tax
-
rowsRepresent
private java.lang.String rowsRepresent
-
days
private java.util.Vector days
-
selectFilters
private java.util.Vector selectFilters
-
-
Constructor Detail
-
InvoiceGenerator
InvoiceGenerator(java.io.File outputFile, java.lang.String title, java.lang.String userDetails, java.lang.String customerDetails, java.lang.String paymentDetails, java.lang.Integer dueDays, java.lang.Double price, java.lang.String currency, java.lang.Double tax, java.lang.String rowsRepresent, java.util.Vector days, java.util.Vector selectFilters)
-
-
Method Detail
-
generateInvoice
void generateInvoice()
Generates invoice based on data provided in constructor of InvoiceGenerator class.
-
writeHeader
private void writeHeader(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeSubjects
private void writeSubjects(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeProjectsTasks
private void writeProjectsTasks(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeTasks
private void writeTasks(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writePaymentDetails
private void writePaymentDetails(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeFooter
private void writeFooter(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeHTMLHeader
private void writeHTMLHeader(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeHTMLSubjects
private void writeHTMLSubjects(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeHTMLProjectsTasks
private void writeHTMLProjectsTasks(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeHTMLTasks
private void writeHTMLTasks(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeHTMLPaymentDetails
private void writeHTMLPaymentDetails(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeHTMLFooter
private void writeHTMLFooter(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeTXTHeader
private void writeTXTHeader(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeTXTSubjects
private void writeTXTSubjects(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeTXTProjectsTasks
private void writeTXTProjectsTasks(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeTXTPaymentDetails
private void writeTXTPaymentDetails(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeTXTFooter
private void writeTXTFooter(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
writeTXTTasks
private void writeTXTTasks(java.io.OutputStreamWriter writer) throws java.io.IOException- Throws:
java.io.IOException
-
getProjectRows
private InvoiceGenerator.ProjectRow[] getProjectRows()
Processes all days in selected period and their tasks and for each non-idle, non-private (unless required) task calculates projects statistic (@see ProjectRow). Finally, sorts all entries according to user's preference.- Returns:
- Sorted array of project rows to be included on the invoice.
-
getTaskRows
private InvoiceGenerator.TaskRow[] getTaskRows()
Processes all days in selected period and their tasks and for each non-idle, non-private (unless required) task calculates its statistic (@see TaskRow). Finally, sorts all entries according to user's preference.- Returns:
- Sorted array of task rows to be included on the invoice.
-
filterTasks
private java.util.Vector filterTasks(java.util.Vector tasks)
Filters given vector of tasks trough all used filters and returns vector of tasks satisfying all filters.- Parameters:
tasks- Vector of tasks to be filtered.- Returns:
- Vector of tasks that satisfied all filters.
-
-