erp_invoicing 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. data/app/controllers/erp_invoicing/erp_app/organizer/bill_pay/accounts_controller.rb +98 -46
  2. data/app/controllers/erp_invoicing/erp_app/organizer/bill_pay/base_controller.rb +1 -1
  3. data/app/controllers/erp_invoicing/erp_app/shared/billing_accounts_controller.rb +111 -0
  4. data/app/controllers/erp_invoicing/erp_app/shared/files_controller.rb +52 -0
  5. data/app/controllers/erp_invoicing/erp_app/shared/invoices_controller.rb +208 -0
  6. data/app/controllers/erp_invoicing/sms_controller.rb +156 -0
  7. data/app/models/billing_account.rb +204 -0
  8. data/app/models/extensions/document.rb +5 -0
  9. data/app/models/extensions/financial_txn.rb +5 -0
  10. data/app/models/extensions/party.rb +10 -0
  11. data/app/models/invoice.rb +100 -7
  12. data/app/models/invoice_item.rb +35 -2
  13. data/app/models/invoice_payment_strategy_type.rb +5 -0
  14. data/app/models/invoice_payment_term.rb +4 -0
  15. data/app/models/invoice_payment_term_set.rb +6 -0
  16. data/app/models/invoice_payment_term_type.rb +3 -0
  17. data/app/models/payment_application.rb +6 -1
  18. data/app/models/recurring_payment.rb +40 -0
  19. data/config/routes.rb +8 -1
  20. data/db/data_migrations/20111121153349_create_bill_pay_organizer_application.rb +1 -1
  21. data/db/data_migrations/20120118181839_create_invoice_management_desktop_application.rb +26 -0
  22. data/db/data_migrations/20120229174322_add_billpay_widget.rb +28 -0
  23. data/db/migrate/20111121000000_invoicing_services.rb +170 -103
  24. data/db/migrate/20120228184317_add_text_to_pay_to_recurring_payments.rb +13 -0
  25. data/db/migrate/20120301155722_add_billing_date_to_billing_account.rb +13 -0
  26. data/lib/erp_invoicing/engine.rb +5 -0
  27. data/lib/erp_invoicing/version.rb +7 -1
  28. data/lib/erp_invoicing.rb +1 -0
  29. data/public/javascripts/erp_app/desktop/applications/invoice_management/billing_accounts_panel.js +80 -0
  30. data/public/javascripts/erp_app/desktop/applications/invoice_management/invoices_panel.js +48 -0
  31. data/public/javascripts/erp_app/desktop/applications/invoice_management/module.js +36 -0
  32. data/public/javascripts/erp_app/organizer/applications/bill_pay/base.js +88 -76
  33. data/public/javascripts/erp_app/organizer/applications/bill_pay/extensions.js +6 -97
  34. data/public/javascripts/erp_app/organizer/applications/bill_pay/make_payment_window.js +19 -13
  35. data/public/javascripts/erp_app/organizer/applications/bill_pay/payment_accounts_grid_panel.js +2 -1
  36. data/public/javascripts/erp_app/shared/add_invoice_window.js +220 -0
  37. data/public/javascripts/erp_app/shared/billing_accounts_grid_panel.js +318 -0
  38. data/public/javascripts/erp_app/shared/invoice_items_grid_panel.js +152 -0
  39. data/public/javascripts/erp_app/shared/invoices_grid_panel.js +363 -0
  40. data/public/javascripts/erp_app/shared/payments_grid_panel.js +74 -0
  41. data/spec/dummy/Rakefile +7 -0
  42. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  43. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  44. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  45. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  46. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  47. data/spec/dummy/config/application.rb +50 -0
  48. data/spec/dummy/config/boot.rb +10 -0
  49. data/spec/dummy/config/database.yml +8 -0
  50. data/spec/dummy/config/environment.rb +5 -0
  51. data/spec/dummy/config/environments/spec.rb +27 -0
  52. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  53. data/spec/dummy/config/initializers/inflections.rb +10 -0
  54. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  55. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  56. data/spec/dummy/config/initializers/session_store.rb +8 -0
  57. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  58. data/spec/dummy/config/locales/en.yml +5 -0
  59. data/spec/dummy/config/routes.rb +3 -0
  60. data/spec/dummy/config.ru +4 -0
  61. data/spec/dummy/public/404.html +26 -0
  62. data/spec/dummy/public/422.html +26 -0
  63. data/spec/dummy/public/500.html +26 -0
  64. data/spec/dummy/public/favicon.ico +0 -0
  65. data/spec/dummy/script/rails +6 -0
  66. data/spec/factories/basic.rb +9 -0
  67. data/spec/models/billing_account_spec.rb +78 -0
  68. data/spec/models/invoice_item_spec.rb +22 -0
  69. data/spec/models/invoice_spec.rb +58 -0
  70. data/spec/models/payment_application_spec.rb +17 -0
  71. data/spec/spec_helper.rb +60 -0
  72. metadata +148 -67
  73. data/app/widgets/bill_pay/base.rb +0 -230
  74. data/app/widgets/bill_pay/helpers/controller/bill_pay_controller_helper.rb +0 -3
  75. data/app/widgets/bill_pay/helpers/view/bill_pay_view_helper.rb +0 -3
  76. data/app/widgets/bill_pay/javascript/bill_pay.js +0 -11
  77. data/app/widgets/bill_pay/views/_menu.html.erb +0 -63
  78. data/app/widgets/bill_pay/views/_payment_history_table.html.erb +0 -115
  79. data/app/widgets/bill_pay/views/_statement_table.html.erb +0 -117
  80. data/app/widgets/bill_pay/views/account_home.html.erb +0 -10
  81. data/app/widgets/bill_pay/views/index.html.erb +0 -4
  82. data/app/widgets/bill_pay/views/make_payment.html.erb +0 -24
  83. data/app/widgets/bill_pay/views/payment_account_forms/bank_account.html.erb +0 -28
  84. data/app/widgets/bill_pay/views/payment_account_forms/credit_card.html.erb +0 -48
  85. data/app/widgets/bill_pay/views/payment_accounts.html.erb +0 -120
  86. data/app/widgets/bill_pay/views/payment_history.html.erb +0 -104
  87. data/app/widgets/bill_pay/views/pdf/layout.pdf.erb +0 -35
  88. data/app/widgets/bill_pay/views/statements.html.erb +0 -4
  89. data/public/javascripts/erp_app/organizer/applications/bill_pay/accounts_grid_panel.js +0 -182
@@ -1,120 +0,0 @@
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
-
@@ -1,104 +0,0 @@
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 History</h2>
102
- <a href="<%=build_widget_url(:download_payment_history)%>">Download History</a>
103
- <br/><br/>
104
- <%= render :partial => '/payment_history_table' , :locals => {:payments => @payments}%>
@@ -1,35 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>Statement</title>
5
- </head>
6
- <style type="text/css">
7
- #container{
8
- width:610px;
9
- }
10
- #body{
11
- font-size: 10px;
12
- font-family: "Lucida Grande";
13
- }
14
- .bold{
15
- font-weight:bold;
16
- }
17
- .center{
18
- text-align:center;
19
- }
20
- img{
21
- border:none;
22
- }
23
- </style>
24
-
25
- <body>
26
- <div id="container">
27
- <h1><%= @title %></h1>
28
- <div id="body">
29
- <div>
30
- <%= render @body_options %>
31
- </div>
32
- </div>
33
- </div>
34
- </body>
35
- </html>
@@ -1,4 +0,0 @@
1
- <h2>My Statement</h2>
2
- <a href="<%=build_widget_url(:download_statement)%>">Download Statement</a>
3
- <br/><br/>
4
- <%= render :partial => '/statement_table' , :locals => {:transactions => @statement[:tranactions]}%>
@@ -1,182 +0,0 @@
1
- Ext.define("Compass.ErpApp.Organizer.Applications.BillPay.AccountsGridPanel",{
2
- extend:"Ext.grid.Panel",
3
- alias:'widget.billpay_accountsgridpanel',
4
- deleteAccount : function(rec){
5
-
6
- },
7
-
8
- initComponent : function(){
9
- this.bbar = Ext.create("Ext.PagingToolbar",{
10
- pageSize: this.initialConfig['pageSize'] || 50,
11
- store:this.store,
12
- displayInfo: true,
13
- displayMsg: '{0} - {1} of {2}',
14
- emptyMsg: "Empty"
15
- });
16
-
17
- this.callParent(arguments);
18
- },
19
-
20
- constructor : function(config) {
21
- var store = Ext.create("Ext.data.Store",{
22
- proxy:{
23
- type:'ajax',
24
- url: '/erp_invoicing/erp_app/organizer/bill_pay/accounts',
25
- reader:{
26
- type:'json',
27
- root: 'accounts'
28
- }
29
- },
30
- extraParams:{
31
- party_id:null,
32
- account_id:null
33
- },
34
- totalProperty: 'totalCount',
35
- idProperty: 'id',
36
- fields:[
37
- 'id',
38
- 'account_number',
39
- 'payment_due',
40
- 'billing_date',
41
- 'due_date',
42
- 'party_id'
43
- ]
44
- });
45
-
46
- config = Ext.apply({
47
- columns: [
48
- {
49
- header:'Account Number',
50
- sortable: true,
51
- dataIndex: 'account_number'
52
- },
53
- {
54
- header:'Payment Due',
55
- sortable: true,
56
- width:150,
57
- dataIndex: 'payment_due'
58
- },
59
- {
60
- header:'Next Billing Date',
61
- sortable: true,
62
- width:150,
63
- dataIndex: 'billing_date'
64
- },
65
- {
66
- header:'Next Payment Due',
67
- sortable: true,
68
- dataIndex: 'due_date'
69
- },
70
- {
71
- menuDisabled:true,
72
- resizable:false,
73
- xtype:'actioncolumn',
74
- header:'Make Payment',
75
- align:'center',
76
- width:100,
77
- items:[{
78
- icon:'/images/icons/creditcards/creditcards_16x16.png',
79
- tooltip:'Make Payment',
80
- handler :function(grid, rowIndex, colIndex){
81
- var rec = grid.getStore().getAt(rowIndex);
82
- var makePaymentWindow = Ext.create("Compass.ErpApp.Organizer.Applications.BillPay.MakePaymentWindow",{
83
- amount:rec.get('payment_due'),
84
- accountId:rec.get('id')
85
- });
86
- makePaymentWindow.show();
87
- }
88
- }]
89
- },
90
- {
91
- menuDisabled:true,
92
- resizable:false,
93
- xtype:'actioncolumn',
94
- header:'Customer Info',
95
- align:'center',
96
- width:100,
97
- items:[{
98
- icon:'/images/icons/about/about_16x16.png',
99
- tooltip:'View Payor Info',
100
- handler :function(grid, rowIndex, colIndex){
101
- var rec = grid.getStore().getAt(rowIndex);
102
- var partyId = rec.get('party_id');
103
-
104
- var individualsGrid = Ext.getCmp('individualSearchGrid');
105
-
106
- var index = individualsGrid.getStore().find("id", partyId);
107
- var record = individualsGrid.getStore().getAt(index);
108
- individualsGrid.getSelectionModel().select([record], false);
109
- Compass.ErpApp.Organizer.Layout.setActiveCenterItem('individuals_search_grid');
110
- var individualsTabPanel = Ext.getCmp('individualsTabPanel');
111
- var accountsGridPanel = individualsTabPanel.query('billpay_accountsgridpanel')[0];
112
- individualsTabPanel.setActiveTab(accountsGridPanel.id);
113
- }
114
- }]
115
- },
116
- {
117
- menuDisabled:true,
118
- resizable:false,
119
- xtype:'actioncolumn',
120
- header:'Delete',
121
- align:'center',
122
- width:60,
123
- items:[{
124
- icon:'/images/icons/delete/delete_16x16.png',
125
- tooltip:'Delete',
126
- handler :function(grid, rowIndex, colIndex){
127
- var rec = grid.getStore().getAt(rowIndex);
128
- grid.deleteOrder(rec);
129
- }
130
- }]
131
- }
132
- ],
133
- loadMask: true,
134
- autoScroll:true,
135
- stripeRows: true,
136
- store:store,
137
- tbar:{
138
- items:[
139
- {
140
- xtype:'numberfield',
141
- hideLabel:true,
142
- emptyText:'Account Number'
143
- },
144
- {
145
- text:'Search',
146
- iconCls:'icon-search',
147
- handler:function(btn){
148
- var accountNumber = btn.findParentByType('toolbar').query('numberfield')[0].getValue();
149
- var store = btn.findParentByType('billpay_accountsgridpanel').getStore();
150
- store.load({
151
- params:{
152
- account_number:accountNumber
153
- }
154
- });
155
- }
156
- },
157
- '|',
158
- {
159
- text: 'All',
160
- xtype:'button',
161
- iconCls: 'icon-eye',
162
- handler: function(btn) {
163
- btn.findParentByType('billpay_accountsgridpanel').store.proxy.extraParams.account_number = null;
164
- btn.findParentByType('billpay_accountsgridpanel').store.load();
165
- }
166
- },
167
- '|',
168
- {
169
- text: 'Add',
170
- xtype:'button',
171
- iconCls: 'icon-add',
172
- handler: function(btn) {
173
-
174
- }
175
- }
176
- ]
177
- }
178
- }, config);
179
-
180
- this.callParent([config]);
181
- }
182
- });