educode_sales 1.0.2 → 1.0.4

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/educode_sales/businesses_controller.rb +4 -1
  3. data/app/controllers/educode_sales/contracts_controller.rb +17 -1
  4. data/app/controllers/educode_sales/follow_ups_controller.rb +13 -12
  5. data/app/controllers/educode_sales/home_controller.rb +14 -0
  6. data/app/controllers/educode_sales/invoices_controller.rb +219 -0
  7. data/app/controllers/educode_sales/key_person_controller.rb +1 -1
  8. data/app/controllers/educode_sales/money_plan_records_controller.rb +116 -0
  9. data/app/controllers/educode_sales/money_plans_controller.rb +32 -28
  10. data/app/controllers/educode_sales/sale_trends_controller.rb +2 -2
  11. data/app/controllers/educode_sales/sales_details_controller.rb +1 -1
  12. data/app/controllers/educode_sales/teachers_controller.rb +7 -2
  13. data/app/models/educode_sales/business.rb +7 -0
  14. data/app/models/educode_sales/invoice.rb +5 -0
  15. data/app/models/educode_sales/invoice_apply.rb +12 -0
  16. data/app/models/educode_sales/invoice_detail.rb +10 -0
  17. data/app/models/educode_sales/key_person.rb +1 -1
  18. data/app/models/educode_sales/money_plan.rb +27 -0
  19. data/app/models/educode_sales/money_plan_claim.rb +7 -0
  20. data/app/models/educode_sales/money_plan_record.rb +7 -0
  21. data/app/models/educode_sales/staff.rb +2 -0
  22. data/app/views/educode_sales/businesses/edit_plan.html.erb +1 -1
  23. data/app/views/educode_sales/businesses/key_person.json.jbuilder +1 -1
  24. data/app/views/educode_sales/contracts/_list.html.erb +1 -1
  25. data/app/views/educode_sales/follow_ups/index.json.jbuilder +1 -1
  26. data/app/views/educode_sales/follow_ups/teachers.json.jbuilder +1 -1
  27. data/app/views/educode_sales/home/search_contracts.json.jbuilder +9 -0
  28. data/app/views/educode_sales/home/search_money_plans.json.jbuilder +9 -0
  29. data/app/views/educode_sales/invoices/_apply_records.html.erb +276 -0
  30. data/app/views/educode_sales/invoices/apply.html.erb +443 -0
  31. data/app/views/educode_sales/invoices/apply_records.js.erb +1 -0
  32. data/app/views/educode_sales/invoices/apply_records.json.jbuilder +20 -0
  33. data/app/views/educode_sales/invoices/details.json.jbuilder +17 -0
  34. data/app/views/educode_sales/invoices/list.json.jbuilder +14 -0
  35. data/app/views/educode_sales/invoices/new.html.erb +177 -0
  36. data/app/views/educode_sales/invoices/sales_details.html.erb +88 -0
  37. data/app/views/educode_sales/invoices/sales_details.json.jbuilder +14 -0
  38. data/app/views/educode_sales/money_plan_records/_index.html.erb +258 -0
  39. data/app/views/educode_sales/money_plan_records/add.html.erb +101 -0
  40. data/app/views/educode_sales/money_plan_records/confirm_plan.html.erb +167 -0
  41. data/app/views/educode_sales/money_plan_records/index.js.erb +1 -0
  42. data/app/views/educode_sales/money_plan_records/index.json.jbuilder +26 -0
  43. data/app/views/educode_sales/money_plans/_index.html.erb +245 -0
  44. data/app/views/educode_sales/money_plans/add.html.erb +147 -0
  45. data/app/views/educode_sales/money_plans/index.json.jbuilder +41 -8
  46. data/app/views/educode_sales/money_plans/list.html.erb +56 -0
  47. data/app/views/educode_sales/sales_details/edit.html.erb +6 -0
  48. data/app/views/educode_sales/teachers/add_keys.html.erb +2 -2
  49. data/app/views/layouts/educode_sales/application.html.erb +245 -236
  50. data/config/routes.rb +32 -1
  51. data/db/migrate/20230527150102_add_category_to_educode_sales_money_plans.rb +7 -0
  52. data/db/migrate/20230528115654_create_educode_sales_money_plan_records.rb +13 -0
  53. data/db/migrate/20230529022020_create_educode_sales_money_plan_claims.rb +12 -0
  54. data/db/migrate/20230531144834_create_educode_sales_invoice_applies.rb +25 -0
  55. data/db/migrate/20230601011835_create_educode_sales_invoices.rb +14 -0
  56. data/db/migrate/20230601011943_create_educode_sales_invoice_details.rb +20 -0
  57. data/lib/educode_sales/version.rb +1 -1
  58. metadata +35 -4
  59. data/app/views/educode_sales/money_plans/index.html.erb +0 -222
data/config/routes.rb CHANGED
@@ -19,11 +19,27 @@ EducodeSales::Engine.routes.draw do
19
19
  get :filter, to: "application#filter"
20
20
  get :search_activity, to: "home#search_activity"
21
21
  get :search_customer, to: "home#search_customer"
22
-
22
+ get :search_contracts, to: "home#search_contracts"
23
+ get :search_money_plans, to: "home#search_money_plans"
23
24
 
24
25
  resources :sessions do
25
26
  end
26
27
 
28
+ resources :invoices do
29
+ collection do
30
+ get :apply_records
31
+ get :apply
32
+ get :details
33
+ get :invoice_amount
34
+ post :create_apply
35
+ post :add_invoice
36
+ get :list
37
+ end
38
+ member do
39
+ get :sales_details
40
+ end
41
+ end
42
+
27
43
  resources :sales_details do
28
44
  collection do
29
45
  post :upload
@@ -62,6 +78,21 @@ EducodeSales::Engine.routes.draw do
62
78
  resources :customer_follows do
63
79
  end
64
80
  resources :money_plans do
81
+ collection do
82
+ get :list
83
+ get :add
84
+ end
85
+ end
86
+
87
+ resources :money_plan_records do
88
+ collection do
89
+ get :add
90
+ get :confirm_plan
91
+ post :upload
92
+ end
93
+ member do
94
+ post :confirm
95
+ end
65
96
  end
66
97
 
67
98
  resources :customers do
@@ -0,0 +1,7 @@
1
+ class AddCategoryToEducodeSalesMoneyPlans < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :educode_sales_money_plans, :category, :integer
4
+ add_column :educode_sales_money_plans, :payment_clause, :string
5
+ add_column :educode_sales_money_plans, :business_id, :integer
6
+ end
7
+ end
@@ -0,0 +1,13 @@
1
+ class CreateEducodeSalesMoneyPlanRecords < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :educode_sales_money_plan_records do |t|
4
+ t.references :business
5
+ t.date :date_at
6
+ t.float :amount
7
+ t.string :payer_name
8
+ t.references :staff
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ class CreateEducodeSalesMoneyPlanClaims < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :educode_sales_money_plan_claims do |t|
4
+ t.references :money_plan
5
+ t.references :money_plan_record
6
+ t.references :staff
7
+ t.float :amount
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,25 @@
1
+ class CreateEducodeSalesInvoiceApplies < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :educode_sales_invoice_applies do |t|
4
+ t.string :number, comment: "开票申请编号"
5
+ t.references :business
6
+ t.references :staff
7
+ t.float :amount, comment: "已开票金额"
8
+ t.integer :invoices_count, comment: "发票数量"
9
+ t.integer :delivery, comment: "送达方式"
10
+ t.date :ticket_at, comment: "出票需求时间"
11
+ t.date :passed_at, comment: "开票时间"
12
+ t.integer :state, comment: "开票状态"
13
+ t.integer :category, comment: "发票类型"
14
+ t.boolean :is_tax_rebate, default: false
15
+ t.string :name, comment: "开票信息名称"
16
+ t.string :taxpaper_number, comment: "纳税人标识号"
17
+ t.string :address, comment: "地址"
18
+ t.string :phone, comment: "电话"
19
+ t.string :bank_number, comment: "银行账号"
20
+ t.string :bank, comment: "开户行"
21
+ t.integer :take_ticket_id, comment: "领票人"
22
+ t.timestamps
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,14 @@
1
+ class CreateEducodeSalesInvoices < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :educode_sales_invoices do |t|
4
+ t.string :number, comment: "发票号码"
5
+ t.float :no_tax_amount, comment: "未税金额"
6
+ t.float :taxt_amount, comment: "税额"
7
+ t.float :amount, comment: "发票金额"
8
+ t.date :date_at, comment: "开票日期"
9
+ t.references :invoice_apply
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ class CreateEducodeSalesInvoiceDetails < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :educode_sales_invoice_details do |t|
4
+ t.references :invoice_apply
5
+ t.references :business
6
+ t.references :sale_detail
7
+ t.integer :num, comment: "数量"
8
+ t.string :specification, comment: "规格"
9
+ t.string :unit, comment: "单位"
10
+ t.float :price, comment: "单价"
11
+ t.integer :category, comment: "类别:软件,硬件"
12
+ t.string :name, comment: "名称"
13
+ t.float :amount, comment: "金额"
14
+ t.integer :state, comment: "开票状态:已开票"
15
+
16
+ t.timestamps
17
+ end
18
+
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: educode_sales
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-25 00:00:00.000000000 Z
11
+ date: 2023-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -156,8 +156,10 @@ files:
156
156
  - app/controllers/educode_sales/idea_recycles_controller.rb
157
157
  - app/controllers/educode_sales/ideas_controller.rb
158
158
  - app/controllers/educode_sales/import_teachers_controller.rb
159
+ - app/controllers/educode_sales/invoices_controller.rb
159
160
  - app/controllers/educode_sales/key_person_controller.rb
160
161
  - app/controllers/educode_sales/logs_controller.rb
162
+ - app/controllers/educode_sales/money_plan_records_controller.rb
161
163
  - app/controllers/educode_sales/money_plans_controller.rb
162
164
  - app/controllers/educode_sales/operation_plans_controller.rb
163
165
  - app/controllers/educode_sales/operation_reports_controller.rb
@@ -223,10 +225,15 @@ files:
223
225
  - app/models/educode_sales/idea.rb
224
226
  - app/models/educode_sales/idea_follow.rb
225
227
  - app/models/educode_sales/idea_history.rb
228
+ - app/models/educode_sales/invoice.rb
229
+ - app/models/educode_sales/invoice_apply.rb
230
+ - app/models/educode_sales/invoice_detail.rb
226
231
  - app/models/educode_sales/key_person.rb
227
232
  - app/models/educode_sales/login_history.rb
228
233
  - app/models/educode_sales/market_area.rb
229
234
  - app/models/educode_sales/money_plan.rb
235
+ - app/models/educode_sales/money_plan_claim.rb
236
+ - app/models/educode_sales/money_plan_record.rb
230
237
  - app/models/educode_sales/operation_plan.rb
231
238
  - app/models/educode_sales/operation_report.rb
232
239
  - app/models/educode_sales/operation_trend.rb
@@ -356,9 +363,11 @@ files:
356
363
  - app/views/educode_sales/home/sales_staff.json.jbuilder
357
364
  - app/views/educode_sales/home/search.json.jbuilder
358
365
  - app/views/educode_sales/home/search_activity.json.jbuilder
366
+ - app/views/educode_sales/home/search_contracts.json.jbuilder
359
367
  - app/views/educode_sales/home/search_customer.json.jbuilder
360
368
  - app/views/educode_sales/home/search_edu_teacher.json.jbuilder
361
369
  - app/views/educode_sales/home/search_edu_user.json.jbuilder
370
+ - app/views/educode_sales/home/search_money_plans.json.jbuilder
362
371
  - app/views/educode_sales/home/search_operation_teacher.json.jbuilder
363
372
  - app/views/educode_sales/home/search_teacher.json.jbuilder
364
373
  - app/views/educode_sales/home/search_users.json.jbuilder
@@ -420,10 +429,26 @@ files:
420
429
  - app/views/educode_sales/ideas/show_teachers.html.erb
421
430
  - app/views/educode_sales/ideas/unfinish_plans.json.jbuilder
422
431
  - app/views/educode_sales/ideas/upload_file.html.erb
432
+ - app/views/educode_sales/invoices/_apply_records.html.erb
433
+ - app/views/educode_sales/invoices/apply.html.erb
434
+ - app/views/educode_sales/invoices/apply_records.js.erb
435
+ - app/views/educode_sales/invoices/apply_records.json.jbuilder
436
+ - app/views/educode_sales/invoices/details.json.jbuilder
437
+ - app/views/educode_sales/invoices/list.json.jbuilder
438
+ - app/views/educode_sales/invoices/new.html.erb
439
+ - app/views/educode_sales/invoices/sales_details.html.erb
440
+ - app/views/educode_sales/invoices/sales_details.json.jbuilder
423
441
  - app/views/educode_sales/logs/index.html.erb
424
442
  - app/views/educode_sales/logs/index.json.jbuilder
425
- - app/views/educode_sales/money_plans/index.html.erb
443
+ - app/views/educode_sales/money_plan_records/_index.html.erb
444
+ - app/views/educode_sales/money_plan_records/add.html.erb
445
+ - app/views/educode_sales/money_plan_records/confirm_plan.html.erb
446
+ - app/views/educode_sales/money_plan_records/index.js.erb
447
+ - app/views/educode_sales/money_plan_records/index.json.jbuilder
448
+ - app/views/educode_sales/money_plans/_index.html.erb
449
+ - app/views/educode_sales/money_plans/add.html.erb
426
450
  - app/views/educode_sales/money_plans/index.json.jbuilder
451
+ - app/views/educode_sales/money_plans/list.html.erb
427
452
  - app/views/educode_sales/operation_plans/_monthPlan.html.erb
428
453
  - app/views/educode_sales/operation_plans/_monthly.html.erb
429
454
  - app/views/educode_sales/operation_plans/_weekPlan.html.erb
@@ -685,6 +710,12 @@ files:
685
710
  - db/migrate/20230510144317_create_educode_sales_sales_details.rb
686
711
  - db/migrate/20230520023902_add_activity_educode_sales_business.rb
687
712
  - db/migrate/20230523115007_add_proprietorship_educode_sales_sales_details.rb
713
+ - db/migrate/20230527150102_add_category_to_educode_sales_money_plans.rb
714
+ - db/migrate/20230528115654_create_educode_sales_money_plan_records.rb
715
+ - db/migrate/20230529022020_create_educode_sales_money_plan_claims.rb
716
+ - db/migrate/20230531144834_create_educode_sales_invoice_applies.rb
717
+ - db/migrate/20230601011835_create_educode_sales_invoices.rb
718
+ - db/migrate/20230601011943_create_educode_sales_invoice_details.rb
688
719
  - lib/educode_sales.rb
689
720
  - lib/educode_sales/engine.rb
690
721
  - lib/educode_sales/version.rb
@@ -708,7 +739,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
708
739
  - !ruby/object:Gem::Version
709
740
  version: '0'
710
741
  requirements: []
711
- rubygems_version: 3.0.0
742
+ rubygems_version: 3.0.9
712
743
  signing_key:
713
744
  specification_version: 4
714
745
  summary: Summary of EducodeSales.
@@ -1,222 +0,0 @@
1
- <div style="margin: 10px 10px 10px 10px">
2
- <form class="layui-form layui-form-pane" lay-filter="search_teachers">
3
- <div class="layui-form-item">
4
- <div class="layui-inline">
5
- <label class="layui-form-label">所属商机</label>
6
- <div class="layui-input-inline">
7
- <input type="text" name="business" class="layui-input">
8
- </div>
9
- </div>
10
- <div class="layui-inline">
11
- <label class="layui-form-label">单位</label>
12
- <div class="layui-input-inline">
13
- <input type="text" name="school" class="layui-input">
14
- </div>
15
- </div>
16
- <div class="layui-inline">
17
- <label class="layui-form-label">负责人</label>
18
- <div class="layui-input-inline">
19
- <%= select_tag "staff_id", options_for_select(@staffs, params[:staff_id]), { 'lay-filter': 'staff_id', include_blank: true } %>
20
- </div>
21
- </div>
22
- <div class="layui-inline">
23
- <label class="layui-form-label">状态</label>
24
- <div class="layui-input-inline">
25
- <%= select_tag "clazz", options_for_select(['实际回款','计划回款']), { include_blank: true } %>
26
- </div>
27
- </div>
28
- <div class="layui-inline">
29
- <label class="layui-form-label">回款时间</label>
30
- <div class="layui-input-inline">
31
- <input type="text" class="layui-input" id="date" name="date" placeholder=" - " autocomplete="off">
32
- </div>
33
- </div>
34
- <div class="layui-inline">
35
- <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
36
- </button>
37
- <button type="submit" class="layui-btn layui-btn-primary" id="search_bt" lay-submit lay-filter="search_teachers">搜 索
38
- </button>
39
- </div>
40
- </div>
41
- </form>
42
- </div>
43
-
44
- <script type="text/html" id="toolbarDemo">
45
- <div class="layui-btn-container">
46
- <span class="table-label">回款计划</span>
47
- </div>
48
- </script>
49
-
50
- <table class="layui-hide" id="place" lay-filter="place"></table>
51
-
52
- <script type="text/html" id="currentTableBar">
53
- </script>
54
- <script type="text/html" id="business">
55
- <a href="javascript:void(0);" lay-event="business" class="layui-table-link">{{ d.business }}</a>
56
- </script>
57
-
58
- <script type="text/html" id="school">
59
- <a href="<%= base_url%>/colleges/{{d.school_id}}/statistics" class="layui-table-link" target="_blank">{{ d.school }}</a>
60
- </script>
61
-
62
- <script>
63
- layui.use(['form', 'table', 'miniPage', 'element', 'request'], function () {
64
- var $ = layui.jquery,
65
- form = layui.form,
66
- table = layui.table,
67
- request = layui.request,
68
- miniPage = layui.miniPage;
69
- laydate = layui.laydate;
70
-
71
-
72
- laydate.render({
73
- elem: '#date',
74
- range: true
75
- });
76
-
77
- table.render({
78
- elem: '#place',
79
- url: '/missions/money_plans',
80
- toolbar: '#toolbarDemo',
81
- totalRow: true,
82
- defaultToolbar: ['filter'],
83
- initSort: {
84
- field: 'date_at' //排序字段,对应 cols 设定的各字段名
85
- ,type: 'desc' //排序方式 asc: 升序、desc: 降序、null: 默认排序
86
- },
87
- cols: [
88
- [
89
- {
90
- field: 'id',
91
- width: 80,
92
- title:'序号',type: 'numbers',
93
- totalRowText:'本页/总计'
94
- },
95
- {
96
- field: 'date_at',
97
- width: 120,
98
- sort: true,
99
- title: '回款时间'
100
- },
101
- {
102
- field: 'amount',
103
- width: 200,
104
- sort: true,
105
- totalRow:true,
106
- title: '回款金额',
107
- },
108
- {
109
- field: 'clazz',
110
- width: 100,
111
- title: '状态',
112
- },
113
- {
114
- field: 'business',
115
- title: '所属商机',
116
- templet: "#business",
117
-
118
- },
119
- {
120
- field: 'school',
121
- title: '单位',
122
- templet: "#school",
123
- },
124
- {
125
- field: 'staff',
126
- width: 90,
127
- title: '负责人',
128
- },
129
- ]
130
- ],
131
- limit: 20,
132
- limits: [10,15,20,30,40,50,60,70,80,90],
133
- page: true
134
- });
135
-
136
- var sort = {}, search = {};
137
- table.on('sort(place)', function (obj) {
138
- sort.field = obj.field;
139
- sort.order = obj.type;
140
- table.reload('place', {
141
- initSort: obj,
142
- where: {
143
- sort: sort,
144
- q: search
145
- }
146
- });
147
- })
148
-
149
- // 监听搜索操作
150
- form.on('submit(search_teachers)', function (data) {
151
- search = data.field
152
- table.reload('place', {
153
- page: {
154
- curr: 1
155
- },
156
- where: {q: search, sort: sort}
157
- }, 'data');
158
- return false;
159
- });
160
-
161
- form.on('submit(reset_business_search)', function (data) {
162
- var field = data.field;
163
- form.val('search_teachers', {
164
- area: "",
165
- date: "",
166
- staff_id: "",
167
- clazz: "",
168
- professional_title: "",
169
- school: "",
170
- business: ""
171
- });
172
- return false;
173
- });
174
-
175
- table.on('tool(place)', function (obj) {
176
- var data = obj.data;
177
- id = data.id
178
- if (obj.event === 'add_event') { // 监听添加操作
179
- var content = miniPage.getHrefContent('/missions/businesses/show_follow_record?follow_up_id=' + data.id);
180
- var openWH = miniPage.getOpenWidthHeight();
181
- show_index = layer.open({
182
- title: '查看商机跟进记录',
183
- type: 1,
184
- shade: 0.2,
185
- maxmin: true,
186
- shadeClose: true,
187
- area: [openWH[0] + 'px', openWH[1] + 'px'],
188
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
189
- content: content
190
- });
191
- $(window).on("resize", function () {
192
- layer.full(index);
193
- });
194
- } else if (obj.event === 'business') {
195
- console.log(data);
196
- business_id = data.business_id
197
- business_name = data.business
198
- content = miniPage.getHrefContent('/missions/businesses/show_follow?id=' + data.business_id);
199
- openWH = miniPage.getOpenWidthHeight();
200
- index = layer.open({
201
- title: '商机列表/' + data.business + '的跟进记录',
202
- type: 1,
203
- shade: 0.2,
204
- maxmin: true,
205
- shadeClose: true,
206
- area: [openWH[0] + 'px', openWH[1] + 'px'],
207
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
208
- content: content
209
- });
210
- $(window).on("resize", function () {
211
- layer.full(index);
212
- });
213
- }
214
- });
215
-
216
- });
217
- </script>
218
- <style>
219
- .layui-table-tool-temp{
220
- padding-right: 0px; !important;
221
- }
222
- </style>