Improved delivery-invoice-workflow.

This commit is contained in:
Benjamin Meichsner 2009-01-18 17:42:51 +01:00
parent 936e6ef69a
commit ff6b460cfc
28 changed files with 253 additions and 231 deletions

View file

@ -0,0 +1,32 @@
- form_for([:finance, @invoice]) do |f|
= f.error_messages
= f.hidden_field :delivery_id
- if @invoice.delivery
%p= "Diese Rechnung ist mit einer #{link_to "Lieferung", [@invoice.supplier,@invoice.delivery]} verknüpft."
%p
= f.label :supplier_id
%br/
= f.select :supplier_id, Supplier.all.collect { |s| [s.name, s.id] }
%p
= f.label :number
%br/
= f.text_field :number
%p
= f.label :date
%br/
= f.date_select :date
%p
= f.label :paid_on
%br/
= f.date_select :paid_on, :include_blank => true
%p
= f.label :amount
%br/
= f.text_field :amount
%p
= f.label :note
%br/
= f.text_area :note
%p
= f.submit "Speichern"

View file

@ -1,36 +1,6 @@
<h1>Editing invoice</h1>
<% form_for([:finance, @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 %>
<%= render :partial => 'form' %>
<%= link_to 'Show', [:finance, @invoice] %> |
<%= link_to 'Back', finance_invoices_path %>

View file

@ -23,7 +23,7 @@
<td><%= invoice.date %></td>
<td><%= invoice.paid_on %></td>
<td><%= invoice.amount %></td>
<td><%=h invoice.delivery_id %></td>
<td><%= link_to "Lieferung", [invoice.supplier,invoice.delivery] if invoice.delivery %></td>
<td><%=h truncate(invoice.note) %></td>
<td><%= link_to 'Show', finance_invoice_path(invoice) %></td>
<td><%= link_to 'Edit', edit_finance_invoice_path(invoice) %></td>

View file

@ -1,35 +1,4 @@
<h1>New invoice</h1>
<% title "Neue Rechnung anlegen" -%>
<% form_for([:finance, @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', finance_invoices_path %>
<%= render :partial => 'form' %>
<%= link_to 'Zurück', finance_invoices_path %>

View file

@ -1,40 +0,0 @@
<% 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_finance_invoice_path(@invoice) %> |
<%= link_to 'Back', finance_invoices_path %>

View file

@ -0,0 +1,28 @@
- title "Rechnung #{@invoice.number}"
%p
%b Supplier:
=h @invoice.supplier.name
- if @invoice.delivery
%p
%b Delivery:
="Diese Rechnung ist mit einer #{link_to "Lieferung", [@invoice.supplier,@invoice.delivery]} verknüpft."
%p
%b Number:
=h @invoice.number
%p
%b Date:
=h @invoice.date
%p
%b Paid on:
=h @invoice.paid_on
%p
%b Amount:
=h @invoice.amount
%p
%b Note:
=h @invoice.note
= link_to 'Edit', edit_finance_invoice_path(@invoice)
|
= link_to 'Back', finance_invoices_path