erp_invoicing 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. data/GPL-3-LICENSE +674 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +31 -0
  4. data/app/assets/javascripts/erp_invoicing/application.js +9 -0
  5. data/app/assets/stylesheets/erp_invoicing/application.css +7 -0
  6. data/app/controllers/erp_invoicing/erp_app/organizer/bill_pay/accounts_controller.rb +108 -0
  7. data/app/controllers/erp_invoicing/erp_app/organizer/bill_pay/base_controller.rb +22 -0
  8. data/app/helpers/erp_invoicing/application_helper.rb +4 -0
  9. data/app/models/extensions/financial_txn_account.rb +7 -0
  10. data/app/models/extensions/product_instance.rb +10 -0
  11. data/app/models/extensions/product_type.rb +10 -0
  12. data/app/models/extensions/work_effort.rb +10 -0
  13. data/app/models/invoice.rb +16 -0
  14. data/app/models/invoice_item.rb +13 -0
  15. data/app/models/invoice_item_type.rb +2 -0
  16. data/app/models/invoice_party_role.rb +7 -0
  17. data/app/models/invoice_type.rb +2 -0
  18. data/app/models/payment_application.rb +6 -0
  19. data/app/views/layouts/erp_invoicing/application.html.erb +14 -0
  20. data/app/widgets/bill_pay/base.rb +230 -0
  21. data/app/widgets/bill_pay/helpers/controller/bill_pay_controller_helper.rb +3 -0
  22. data/app/widgets/bill_pay/helpers/view/bill_pay_view_helper.rb +3 -0
  23. data/app/widgets/bill_pay/javascript/bill_pay.js +11 -0
  24. data/app/widgets/bill_pay/views/_menu.html.erb +63 -0
  25. data/app/widgets/bill_pay/views/_payment_history_table.html.erb +115 -0
  26. data/app/widgets/bill_pay/views/_statement_table.html.erb +117 -0
  27. data/app/widgets/bill_pay/views/account_home.html.erb +10 -0
  28. data/app/widgets/bill_pay/views/index.html.erb +4 -0
  29. data/app/widgets/bill_pay/views/make_payment.html.erb +24 -0
  30. data/app/widgets/bill_pay/views/payment_account_forms/bank_account.html.erb +28 -0
  31. data/app/widgets/bill_pay/views/payment_account_forms/credit_card.html.erb +48 -0
  32. data/app/widgets/bill_pay/views/payment_accounts.html.erb +120 -0
  33. data/app/widgets/bill_pay/views/payment_history.html.erb +104 -0
  34. data/app/widgets/bill_pay/views/pdf/layout.pdf.erb +35 -0
  35. data/app/widgets/bill_pay/views/statements.html.erb +4 -0
  36. data/config/routes.rb +6 -0
  37. data/db/data_migrations/20111121153349_create_bill_pay_organizer_application.rb +14 -0
  38. data/db/migrate/20111121000000_invoicing_services.rb +197 -0
  39. data/lib/erp_invoicing/engine.rb +10 -0
  40. data/lib/erp_invoicing/version.rb +3 -0
  41. data/lib/erp_invoicing.rb +4 -0
  42. data/lib/tasks/erp_invoicing_tasks.rake +4 -0
  43. data/public/javascripts/erp_app/organizer/applications/bill_pay/accounts_grid_panel.js +182 -0
  44. data/public/javascripts/erp_app/organizer/applications/bill_pay/base.js +134 -0
  45. data/public/javascripts/erp_app/organizer/applications/bill_pay/extensions.js +112 -0
  46. data/public/javascripts/erp_app/organizer/applications/bill_pay/make_payment_window.js +103 -0
  47. data/public/javascripts/erp_app/organizer/applications/bill_pay/payment_accounts_grid_panel.js +104 -0
  48. data/public/javascripts/erp_app/organizer/applications/bill_pay/transactions_grid_panel.js +84 -0
  49. metadata +187 -0
@@ -0,0 +1,3 @@
1
+ module BillPayControllerHelper
2
+ #add helper methods for you engines controller
3
+ end
@@ -0,0 +1,3 @@
1
+ module BillPayViewHelper
2
+ #add helper methods for your engines views
3
+ end
@@ -0,0 +1,11 @@
1
+ Compass.ErpApp.Widgets.BillPay = {
2
+ addBillPay:function(){
3
+ Ext.getCmp('knitkitCenterRegion').addContentToActiveCodeMirror('<%= render_widget :bill_pay %>');
4
+ }
5
+ }
6
+
7
+ Compass.ErpApp.Widgets.AvailableWidgets.push({
8
+ name:'Bill Pay',
9
+ iconUrl:'/images/icons/creditcards/creditcards_48x48.png',
10
+ onClick:Compass.ErpApp.Widgets.BillPay.addBillPay
11
+ });
@@ -0,0 +1,63 @@
1
+ <style>
2
+ #nav-menu ul
3
+ {
4
+ list-style: none;
5
+ padding: 0;
6
+ margin: 0;
7
+ }
8
+
9
+ #nav-menu li
10
+ {
11
+ float: left;
12
+ margin: 0 0.15em;
13
+ }
14
+
15
+ #nav-menu li a
16
+ {
17
+ background: url(background.gif) #fff bottom left repeat-x;
18
+ height: 2em;
19
+ line-height: 2em;
20
+ float: left;
21
+ width: 9em;
22
+ display: block;
23
+ border: 0.1em solid #dcdce9;
24
+ color: #0d2474;
25
+ text-decoration: none;
26
+ text-align: center;
27
+ }
28
+
29
+ #nav-menu li a:hover
30
+ {
31
+ background-color:#CCC
32
+ }
33
+
34
+ #nav-menu span.selected a
35
+ {
36
+ background-color:#CCC
37
+ }
38
+
39
+ /* Hide from IE5-Mac \*/
40
+ #nav-menu li a
41
+ {
42
+ float: none
43
+ }
44
+ /* End hide */
45
+ </style>
46
+
47
+ <ul id="nav-menu" style="margin:0px;">
48
+ <li style="list-style:none">
49
+ <%=link_to_remote 'Account Home', build_widget_url(:account_home)%>
50
+ </li>
51
+ <li style="list-style:none">
52
+ <%=link_to_remote 'Statements', build_widget_url(:statements)%>
53
+ </li>
54
+ <li style="list-style:none">
55
+ <%=link_to_remote 'Payment History', build_widget_url(:payment_history)%>
56
+ </li>
57
+ <li style="list-style:none">
58
+ <%=link_to_remote 'Payment Accounts', build_widget_url(:payment_accounts)%>
59
+ </li>
60
+ </ul>
61
+ <br/>
62
+ <br/>
63
+ <br/>
@@ -0,0 +1,115 @@
1
+ <style>
2
+ *
3
+ {
4
+ border: 0;
5
+ margin: 0;
6
+ padding: 0;
7
+ }
8
+
9
+ table
10
+ {
11
+ text-align: left;
12
+ border-spacing: 0px;
13
+ border: 1px solid #aeb3b6;
14
+ border-collapse: collapse;
15
+
16
+ }
17
+
18
+
19
+ table a, table, tbody, tfoot, tr, th, td
20
+ {
21
+ font-family: Arial, Helvetica, sans-serif;
22
+ line-height: 2.0em;
23
+ font-size: 13px;
24
+ color: #55595c;
25
+ }
26
+ tbody td{
27
+ line-height: 2.5em;
28
+ }
29
+
30
+ table caption
31
+ {
32
+ padding: .4em 0 ;
33
+ font-size: 240%;
34
+ font-style: normal;
35
+ color: #FB7E00;
36
+ }
37
+
38
+ table a
39
+ {
40
+ display: block;
41
+ text-decoration: none;
42
+ color: #FF8E53;
43
+ padding-right: 1.5em;
44
+
45
+ }
46
+
47
+ table a:hover, table a:focus
48
+ {
49
+ text-decoration: underline;
50
+ }
51
+
52
+ table th a
53
+ {
54
+ color: #FF8E53;
55
+ text-align: right;
56
+ }
57
+ table .odd th a,table .odd td a,table .odd td{
58
+ color: #666;
59
+ padding-right: 1.0 em;
60
+ }
61
+
62
+ table th a:hover, table th a:focus, tbody tr:hover th
63
+ {
64
+ background-color: #FFCC99;
65
+ color: #fff !important;
66
+ }
67
+ table .odd th,table .odd td{
68
+ background-color: #DDDDDD;
69
+ }
70
+
71
+ thead th
72
+ {
73
+ color: #25c1e2;
74
+ }
75
+
76
+ tbody th
77
+ {
78
+ padding-right: 1.0em;
79
+ color: #25c1e2;
80
+ font-style: normal;
81
+ background-color: #fff;
82
+ border-bottom: 1px dotted #aeb3b6;
83
+ }
84
+
85
+ td
86
+ {
87
+ color: #FF8E1C;
88
+ border-bottom: 1px dotted #aeb3b6;
89
+ padding-right: 0.5em;
90
+
91
+ }
92
+
93
+ tbody tr.odd
94
+ {
95
+ border-bottom: 1px dotted #aeb3b6;
96
+ }
97
+ </style>
98
+ <table style="width:100%">
99
+ <thead>
100
+ <tr>
101
+ <th style="color:#55595C">Payment Date</th>
102
+ <th style="color:#55595C">Post Date</th>
103
+ <th style="color:#55595C">Payment Account</th>
104
+ <th style="color:#55595C">Amount</th>
105
+ </tr>
106
+ </thead>
107
+ <% @payments.each do |payment|%>
108
+ <tr <%="class=odd" if @payments.index(payment) % 2 == 0 %>>
109
+ <td><%= payment[:payment_date]%></td>
110
+ <td><%= payment[:post_date]%></td>
111
+ <td><%= payment[:payment_account]%></td>
112
+ <td><%= number_to_currency(payment[:amount])%></td>
113
+ </tr>
114
+ <%end%>
115
+ </table>
@@ -0,0 +1,117 @@
1
+ <style>
2
+ *
3
+ {
4
+ border: 0;
5
+ margin: 0;
6
+ padding: 0;
7
+ }
8
+
9
+ table
10
+ {
11
+ text-align: left;
12
+ border-spacing: 0px;
13
+ border: 1px solid #aeb3b6;
14
+ border-collapse: collapse;
15
+
16
+ }
17
+
18
+
19
+ table a, table, tbody, tfoot, tr, th, td
20
+ {
21
+ font-family: Arial, Helvetica, sans-serif;
22
+ line-height: 2.0em;
23
+ font-size: 13px;
24
+ color: #55595c;
25
+ }
26
+ tbody td{
27
+ line-height: 2.5em;
28
+ }
29
+
30
+ table caption
31
+ {
32
+ padding: .4em 0 ;
33
+ font-size: 240%;
34
+ font-style: normal;
35
+ color: #FB7E00;
36
+ }
37
+
38
+ table a
39
+ {
40
+ display: block;
41
+ text-decoration: none;
42
+ color: #FF8E53;
43
+ padding-right: 1.5em;
44
+
45
+ }
46
+
47
+ table a:hover, table a:focus
48
+ {
49
+ text-decoration: underline;
50
+ }
51
+
52
+ table th a
53
+ {
54
+ color: #FF8E53;
55
+ text-align: right;
56
+ }
57
+ table .odd th a,table .odd td a,table .odd td{
58
+ color: #666;
59
+ padding-right: 1.0 em;
60
+ }
61
+
62
+ table th a:hover, table th a:focus, tbody tr:hover th
63
+ {
64
+ background-color: #FFCC99;
65
+ color: #fff !important;
66
+ }
67
+ table .odd th,table .odd td{
68
+ background-color: #DDDDDD;
69
+ }
70
+
71
+ thead th
72
+ {
73
+ text-transform: uppercase;
74
+ font-weight: normal;
75
+ letter-spacing: 1px;
76
+ color: #25c1e2;
77
+ }
78
+
79
+ tbody th
80
+ {
81
+ padding-right: 1.0em;
82
+ color: #25c1e2;
83
+ font-style: normal;
84
+ background-color: #fff;
85
+ border-bottom: 1px dotted #aeb3b6;
86
+ }
87
+
88
+ td
89
+ {
90
+ color: #FF8E1C;
91
+ border-bottom: 1px dotted #aeb3b6;
92
+ padding-right: 0.5em;
93
+
94
+ }
95
+
96
+ tbody tr.odd
97
+ {
98
+ border-bottom: 1px dotted #aeb3b6;
99
+ }
100
+ </style>
101
+
102
+ <table style="width:100%">
103
+ <thead>
104
+ <tr>
105
+ <th style="color:#55595C">Date</th>
106
+ <th style="color:#55595C">Description</th>
107
+ <th style="color:#55595C">Amount</th>
108
+ </tr>
109
+ </thead>
110
+ <% transactions.each do |transaction|%>
111
+ <tr <%="class=odd" if transactions.index(transaction) % 2 == 0 %>>
112
+ <td><%= transaction[:date]%></td>
113
+ <td><%= transaction[:description]%></td>
114
+ <td><%= number_to_currency(transaction[:amount])%></td>
115
+ </tr>
116
+ <%end%>
117
+ </table>
@@ -0,0 +1,10 @@
1
+ <h2>Accounts</h2>
2
+ <h3>Account <%=@account[:account_number]%></h3>
3
+ <table>
4
+ <tr><td>Payment Due</td><td><%=number_to_currency(@account[:payment_due])%></td></tr>
5
+ <tr><td>Billing Date</td><td><%=@account[:billing_date]%></td></tr>
6
+ <tr><td>Due Date</td><td><%=@account[:due_date]%></td></tr>
7
+ <tr><td>
8
+ <%=link_to_remote 'Make Payment', build_widget_url(:make_payment)%>
9
+ </td></tr>
10
+ </table>
@@ -0,0 +1,4 @@
1
+ <%=render :partial => '/menu'%>
2
+ <div id="<%=widget_result_id%>">
3
+ <%= render :file => @account_home_template %>
4
+ </div>
@@ -0,0 +1,24 @@
1
+ <%= form_remote_tag build_widget_url(:submit_payment) do %>
2
+ <h2>Make A Payment</h2>
3
+ <div class="form_settings">
4
+ <div id="errors" style="color:red">
5
+ <%=raw @message%>
6
+ </div>
7
+ <br/>
8
+ <p>
9
+ <span>Amount</span>
10
+ <%= text_field_tag :amount, params[:amount], :style => 'width:75px;' %>
11
+ </p>
12
+ <p>
13
+ <span>Payment Date</span>
14
+ <%= text_field_tag :payment_date, params[:payment_date], :style => 'width:75px;', :id => 'payment_date' %>&nbsp;<a href="#" onclick="displayDatePicker('payment_date');">Pick Date</a>
15
+ </p>
16
+ <p>
17
+ <span>Account</span>
18
+ <%= select_tag(:account, options_for_select(@accounts, params[:account])) %>
19
+ </p>
20
+ <p style="padding-top: 15px">
21
+ <%= submit_tag "Submit", :disable_with => "Please wait...", :class => "submit", :style => 'margin:0px;' %> | <%=link_to_remote 'Cancel', build_widget_url(:account_home)%>
22
+ </p>
23
+ </div>
24
+ <%end%>
@@ -0,0 +1,28 @@
1
+ <%= form_remote_tag build_widget_url(:save_payment_account) do %>
2
+ <div class="form_settings">
3
+ <h2></h2>
4
+ <div id="errors" style="color:red">
5
+ <%=raw @message%>
6
+ </div>
7
+ <br/>
8
+ <p>
9
+ <span>Description</span>
10
+ <%= text_field_tag :description, @account[:description] %>
11
+ </p>
12
+ <p>
13
+ <span>Routing Number</span>
14
+ <%= text_field_tag :routing_number, @account[:routing_number] %>
15
+ </p>
16
+ <p>
17
+ <span>Account Number</span>
18
+ <%= text_field_tag :account_number, @account[:account_number] %>
19
+ </p>
20
+ <p>
21
+ <span>Confirm Account Number</span>
22
+ <%= text_field_tag :account_number, @account[:account_number] %>
23
+ </p>
24
+ <p style="padding-top: 15px">
25
+ <%= submit_tag "Save", :disable_with => "Please wait...", :class => "submit", :style => 'margin:0px;' %> | <%=link_to_remote 'Cancel', build_widget_url(:payment_accounts)%>
26
+ </p>
27
+ </div>
28
+ <%end%>
@@ -0,0 +1,48 @@
1
+ <%= form_remote_tag build_widget_url(:save_payment_account) do %>
2
+ <div class="form_settings">
3
+ <h2></h2>
4
+ <div id="errors" style="color:red">
5
+ <%=raw @message%>
6
+ </div>
7
+ <br/>
8
+ <p>
9
+ <span>Description</span>
10
+ <%= text_field_tag :description, @account[:description] %>
11
+ </p>
12
+ <p>
13
+ <span>Name On Card</span>
14
+ <%= text_field_tag :name_on_card, @account[:name_on_card] %>
15
+ </p>
16
+ <p>
17
+ <span>Credit Card Number</span>
18
+ <%= text_field_tag :card_number, @account[:card_number] %>
19
+ </p>
20
+ <p>
21
+ <span>Expiration Month</span>
22
+ <%= select_tag(:exp_month,
23
+ options_for_select([["1 - January", 1],
24
+ ["2 - Febuary", 2],
25
+ ["3 - March",3],
26
+ ["4 - April",4],
27
+ ["5 - May",5],
28
+ ["6 - June",6],
29
+ ["7 - July",7],
30
+ ["8 - August",8],
31
+ ["9 - September",9],
32
+ ["10 - October",10],
33
+ ["11 - November",11],
34
+ ["12 - December",12]], @account[:exp_month])) %>
35
+ </p>
36
+ <p>
37
+ <span>Expiration Year</span>
38
+ <%= select_tag(:exp_year, options_for_select((0..30).collect{|addition| Date.today.year + addition}, @account[:exp_year])) %>
39
+ </p>
40
+ <p>
41
+ <span>Card Security Code</span>
42
+ <%= text_field_tag :security_code, @account[:security_code] %>
43
+ </p>
44
+ <p style="padding-top: 15px">
45
+ <%= submit_tag "Save", :disable_with => "Please wait...", :class => "submit", :style => 'margin:0px;' %> | <%=link_to_remote 'Cancel', build_widget_url(:payment_accounts)%>
46
+ </p>
47
+ </div>
48
+ <%end%>
@@ -0,0 +1,120 @@
1
+ <style>
2
+ *
3
+ {
4
+ border: 0;
5
+ margin: 0;
6
+ padding: 0;
7
+ }
8
+
9
+ table
10
+ {
11
+ text-align: left;
12
+ border-spacing: 0px;
13
+ border: 1px solid #aeb3b6;
14
+ border-collapse: collapse;
15
+
16
+ }
17
+
18
+
19
+ table a, table, tbody, tfoot, tr, th, td
20
+ {
21
+ font-family: Arial, Helvetica, sans-serif;
22
+ line-height: 2.0em;
23
+ font-size: 13px;
24
+ color: #55595c;
25
+ }
26
+ tbody td{
27
+ line-height: 2.5em;
28
+ }
29
+
30
+ table caption
31
+ {
32
+ padding: .4em 0 ;
33
+ font-size: 240%;
34
+ font-style: normal;
35
+ color: #FB7E00;
36
+ }
37
+
38
+ table a
39
+ {
40
+ display: block;
41
+ text-decoration: none;
42
+ color: #FF8E53;
43
+ padding-right: 1.5em;
44
+
45
+ }
46
+
47
+ table a:hover, table a:focus
48
+ {
49
+ text-decoration: underline;
50
+ }
51
+
52
+ table th a
53
+ {
54
+ color: #FF8E53;
55
+ text-align: right;
56
+ }
57
+ table .odd th a,table .odd td a,table .odd td{
58
+ color: #666;
59
+ padding-right: 1.0 em;
60
+ }
61
+
62
+ table th a:hover, table th a:focus, tbody tr:hover th
63
+ {
64
+ background-color: #FFCC99;
65
+ color: #fff !important;
66
+ }
67
+ table .odd th,table .odd td{
68
+ background-color: #DDDDDD;
69
+ }
70
+
71
+ thead th
72
+ {
73
+ text-transform: uppercase;
74
+ font-weight: normal;
75
+ letter-spacing: 1px;
76
+ color: #25c1e2;
77
+ }
78
+
79
+ tbody th
80
+ {
81
+ padding-right: 1.0em;
82
+ color: #25c1e2;
83
+ font-style: normal;
84
+ background-color: #fff;
85
+ border-bottom: 1px dotted #aeb3b6;
86
+ }
87
+
88
+ td
89
+ {
90
+ color: #FF8E1C;
91
+ border-bottom: 1px dotted #aeb3b6;
92
+ padding-right: 0.5em;
93
+
94
+ }
95
+
96
+ tbody tr.odd
97
+ {
98
+ border-bottom: 1px dotted #aeb3b6;
99
+ }
100
+ </style>
101
+ <h2>Payment Accounts</h2>
102
+ <table style="width:100%">
103
+ <thead>
104
+ <tr>
105
+ <th style="color:#55595C">Description</th>
106
+ <th style="color:#55595C">Account Type</th>
107
+ <th style="color:#55595C">Action</th>
108
+ </tr>
109
+ </thead>
110
+ <%@payment_accounts.each do |payment_account|%>
111
+ <tr>
112
+ <td><%=payment_account[:description]%></td>
113
+ <td><%=payment_account[:account_type]%></td>
114
+ <td>
115
+ <%=link_to_remote 'Edit', build_widget_url(payment_account[:edit_action])%><%=link_to_remote 'Delete', build_widget_url(:delete_payment_account)%>
116
+ </td>
117
+ </tr>
118
+ <%end%>
119
+ </table>
120
+