<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>db/migrate/005_add_project_id_to_invoices.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,6 @@
 class Invoice &lt; ActiveRecord::Base
   belongs_to :customer  
+  belongs_to :project
   has_many :payments
   before_save :textilize
   </diff>
      <filename>app/models/invoice.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,10 @@
 &lt;/p&gt;
 
 &lt;p&gt;
+  &lt;%= form.select :project_id, Project.find(:all, :order =&gt; 'name ASC').collect { |p| [h(p.name), p.id]}, { :include_blank =&gt; true} %&gt;
+&lt;/p&gt;
+
+&lt;p&gt;
   &lt;%= form.text_field :invoiced_on, :size =&gt; 10 %&gt;&lt;%= calendar_for('invoice_invoiced_on') %&gt;
 &lt;/p&gt;
 </diff>
      <filename>app/views/invoice/_form.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,9 @@
     &lt;%= h row.customer.company %&gt; - &lt;%= h row.customer.name %&gt;
   &lt;/td&gt;
   &lt;td&gt;
+    &lt;%= h row.project.name unless row.project.nil? %&gt;
+  &lt;/td&gt;
+  &lt;td&gt;
     &lt;%= h number_to_currency(row.amount, :unit =&gt; @settings['invoice_currency_symbol']) %&gt;
   &lt;/td&gt;
 &lt;/tr&gt;</diff>
      <filename>app/views/invoice/_row.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@
     &lt;th&gt;Invoice Number&lt;/th&gt;
     &lt;th&gt;Date Issued&lt;/th&gt;
     &lt;th&gt;Customer&lt;/th&gt;
+    &lt;th&gt;Project&lt;/th&gt;
     &lt;th&gt;Amount&lt;/th&gt;
   &lt;/tr&gt;
   &lt;%= render :partial =&gt; 'row', :collection =&gt; invoices %&gt;</diff>
      <filename>app/views/invoice/_table.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 page['invoice_amount'].value = @total
+page['invoice_project_id'].value = @p.id
 
 # Invoice description
 description = ''</diff>
      <filename>app/views/invoice/autofill.js.rjs</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ed9ec842ce3f83c73a96a2d968da4decd019a442</id>
    </parent>
  </parents>
  <author>
    <name>Eric Davis</name>
    <email>edavis@littlestreamsoftware.com</email>
  </author>
  <url>http://github.com/edavis10/redmine-invoice-plugin/commit/b9b41b964b1d78c0180a247a5f23b74c44c0a2d7</url>
  <id>b9b41b964b1d78c0180a247a5f23b74c44c0a2d7</id>
  <committed-date>2008-11-25T16:05:33-08:00</committed-date>
  <authored-date>2008-11-25T16:05:33-08:00</authored-date>
  <message>Invoices can now be assigned to a project

* Added association Invoice belongs to Project
* Added form fields to store the association
* Modified the autofill to select the project in the Invoice form</message>
  <tree>2d329faeb569c0ef79920f9de38af5408da398fb</tree>
  <committer>
    <name>Eric Davis</name>
    <email>edavis@littlestreamsoftware.com</email>
  </committer>
</commit>
