Java Reference
In-Depth Information
The process involved in creating an invoice is to scan the Billings Table for matters
where the status indicates that the matter is still open. (When a client matter has been
resolved, and the final invoice paid, the status is set to indicate that the matter is
closed.) The links between the tables are shown in Figure 2-3 .
Figure 2-3: Invoices are generated by creating a list of billable items which have not been
previously invoiced.
The next step is to compare the Invoiced_Items Table against the Billable_Items
Table to find items associated with an open Client_Matter that have not been invoiced.
Items that have not been invoiced are added to the Invoiced_Items Table, with their
Invoice_ID set to indicate which invoice they were billed on. The Invoiced_Items
Table is shown in Table 2-8 .
Table 2-8: Invoiced Items Table
id
matter_id
item_id
invoice_id
10001
2006
2031
1007
10007
2119
2047
1063
Another way to handle this is to add an Invoice_Id column to the Billable_Items Table.
The Invoice_Id is then updated when the item is invoiced. The advantage of this
approach is that you are not adding a new table with a one-to-one relationship with an
existing table. The disadvantage is that updating a table can be slow compared to
adding a new row.
Table 2 -9 shows the Invoice Table. The Invoice Number column provides a legacy
system compatible invoice number, and the start date and end date columns identify
the billing period covered by the invoice. The Billing Rate Id column is a foreign key
Search WWH ::




Custom Search