Introduced invoices and deliveries. Integration (especially of deliveries) isn't finished yet.
This commit is contained in:
parent
1894f27fe0
commit
30f3d199d3
65 changed files with 1193 additions and 209 deletions
36
app/views/invoices/edit.html.erb
Normal file
36
app/views/invoices/edit.html.erb
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<h1>Editing invoice</h1>
|
||||
|
||||
<% form_for(@invoice) do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<p>
|
||||
<%= f.label :supplier_id %><br />
|
||||
<%= f.select :supplier_id, Supplier.all.collect { |s| [s.name, s.id] } %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :number %><br />
|
||||
<%= f.text_field :number %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :date %><br />
|
||||
<%= f.date_select :date %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :paid_on %><br />
|
||||
<%= f.date_select :paid_on, :include_blank => true %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :amount %><br />
|
||||
<%= f.text_field :amount %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :note %><br />
|
||||
<%= f.text_area :note %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.submit "Update" %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Show', @invoice %> |
|
||||
<%= link_to 'Back', invoices_path %>
|
||||
32
app/views/invoices/index.html.erb
Normal file
32
app/views/invoices/index.html.erb
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<% title "Invoices" %>
|
||||
|
||||
<table class="list" style="width:70em">
|
||||
<tr>
|
||||
<th>Supplier</th>
|
||||
<th>Number</th>
|
||||
<th>Date</th>
|
||||
<th>Paid on</th>
|
||||
<th>Amount</th>
|
||||
<th>Delivery</th>
|
||||
<th>Note</th>
|
||||
</tr>
|
||||
|
||||
<% for invoice in @invoices %>
|
||||
<tr>
|
||||
<td><%=h invoice.supplier.name %></td>
|
||||
<td><%=h invoice.number %></td>
|
||||
<td><%= invoice.date %></td>
|
||||
<td><%= invoice.paid_on %></td>
|
||||
<td><%= invoice.amount %></td>
|
||||
<td><%=h invoice.delivery_id %></td>
|
||||
<td><%=h truncate(invoice.note) %></td>
|
||||
<td><%= link_to 'Show', invoice %></td>
|
||||
<td><%= link_to 'Edit', edit_invoice_path(invoice) %></td>
|
||||
<td><%= link_to 'Destroy', invoice, :confirm => 'Are you sure?', :method => :delete %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New invoice', new_invoice_path %>
|
||||
35
app/views/invoices/new.html.erb
Normal file
35
app/views/invoices/new.html.erb
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<h1>New invoice</h1>
|
||||
|
||||
<% form_for(@invoice) do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<p>
|
||||
<%= f.label :supplier_id %><br />
|
||||
<%= f.select :supplier_id, Supplier.all.collect { |s| [s.name, s.id] } %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :number %><br />
|
||||
<%= f.text_field :number %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :date %><br />
|
||||
<%= f.date_select :date %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :paid_on %><br />
|
||||
<%= f.date_select :paid_on, :include_blank => true %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :amount %><br />
|
||||
<%= f.text_field :amount %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :note %><br />
|
||||
<%= f.text_area :note %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.submit "Create" %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Back', invoices_path %>
|
||||
40
app/views/invoices/show.html.erb
Normal file
40
app/views/invoices/show.html.erb
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<% title "Show invoice #{@invoice.number}" %>
|
||||
|
||||
<p>
|
||||
<b>Supplier:</b>
|
||||
<%=h @invoice.supplier.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Delivery:</b>
|
||||
<%=h @invoice.delivery_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Number:</b>
|
||||
<%=h @invoice.number %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Date:</b>
|
||||
<%=h @invoice.date %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Paid on:</b>
|
||||
<%=h @invoice.paid_on %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Amount:</b>
|
||||
<%=h @invoice.amount %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Note:</b>
|
||||
<%=h @invoice.note %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_invoice_path(@invoice) %> |
|
||||
<%= link_to 'Back', invoices_path %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue