-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Combine invoice seller and buyer address parts - Convert HAML to ERB - Extract translations - Extract partials - Improve database structure - Improve UI - Remove unnecessary validations Closes #1189, #1188
- Loading branch information
Artur Beljajev
committed
Jun 27, 2019
1 parent
32a0365
commit 5f99bd8
Showing
53 changed files
with
880 additions
and
433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class Address | ||
attr_reader :parts | ||
|
||
def initialize(parts) | ||
@parts = parts | ||
end | ||
|
||
def street | ||
parts[:street] | ||
end | ||
|
||
def zip | ||
parts[:zip] | ||
end | ||
|
||
def city | ||
parts[:city] | ||
end | ||
|
||
def state | ||
parts[:state] | ||
end | ||
|
||
def country | ||
parts[:country] | ||
end | ||
|
||
def ==(other) | ||
parts == other.parts | ||
end | ||
|
||
def to_s | ||
ordered_parts = [street, city, state, zip, country] | ||
ordered_parts.reject(&:blank?).compact.join(', ') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class BankAccount | ||
include ActiveModel::Model | ||
|
||
attr_accessor :iban | ||
attr_accessor :swift | ||
attr_accessor :bank_name | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Company | ||
include ActiveModel::Model | ||
|
||
attr_accessor :name | ||
attr_accessor :registration_number | ||
attr_accessor :vat_number | ||
attr_accessor :address | ||
attr_accessor :email | ||
attr_accessor :phone | ||
attr_accessor :website | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<tr> | ||
<td><%= link_to invoice, admin_invoice_path(invoice) %></td> | ||
<td><%= link_to invoice.registrar, admin_registrar_path(invoice.registrar) %></td> | ||
|
||
<% if invoice.cancelled? %> | ||
<td class="text-grey"> | ||
<%= t(:cancelled) %> | ||
</td> | ||
<% else %> | ||
<td> | ||
<%= l invoice.due_date %> | ||
</td> | ||
<% end %> | ||
<% if invoice.paid? %> | ||
<td> | ||
<%= l invoice.receipt_date %> | ||
</td> | ||
<% elsif invoice.cancelled? %> | ||
<td class="text-grey"> | ||
<%= t(:cancelled) %> | ||
</td> | ||
<% else %> | ||
<td class="text-danger"> | ||
<%= t(:unpaid) %> | ||
</td> | ||
<% end %> | ||
</tr> |
Oops, something went wrong.