blsm-vd-core 0.7.8 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88eb769d8f1f8b766c331a5262a921eae496eca0
4
- data.tar.gz: cd122a4b340b889ce0b461ebda72032d3d76f714
3
+ metadata.gz: a069ba05cde82b661959f01d83fe63f1b441189d
4
+ data.tar.gz: b0c79284b266fc27f7f6791bbce34f495ac6dbe0
5
5
  SHA512:
6
- metadata.gz: 518848866205b77e4df608314fce2ebf0f83a77584e0a731a163977c4acb5f3a4d0022f8aee9101c9d69d032b94ed73b14b212a9aad5e8e63a23d92d6ec0e0f7
7
- data.tar.gz: 6bde110e953670e59fb30f0340e4feb392d135d73005e985de5c14257053e7def01aee1c1132bb6848b8018518189acd8cda7803454f1666f45823522d6fd151
6
+ metadata.gz: 496bfa14705c081fe1cd753ba05da262555b623b038c93947a3cb07f0bcfc3a7700786f085e288fd0c7826d3a92ec7de863a3dce7d1f4eaf18d09ae707d1740e
7
+ data.tar.gz: be53804e26b9b2eb79e665e90cce1f141c87d774c8139f922d32279dcada6dd409b2e2cce5c8e44492517921bffce70e660bdf802619e91bab0e5dc89c2ffaec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-vd-core (0.7.8)
4
+ blsm-vd-core (0.8.0)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
@@ -28,7 +28,7 @@ module BlsmVdCore
28
28
  update_params[:notes] = note
29
29
  update_params[:state] = 'CASH_BACK'
30
30
  if self.order.toggle_delivery_deposit && self.order.pay_type.to_i==1
31
- update_params[:real_amount] = self.order.payment_total.to_f+self.express_service_fee - (self.earn_amount - self.order_amount + self.order.real_shipping_charge * 2) - reduce_real_amount
31
+ update_params[:real_amount] = self.express_service_fee - (self.earn_amount - self.order_amount) - reduce_real_amount
32
32
  else
33
33
  update_params[:real_amount] = self.express_service_fee - (self.earn_amount - self.order_amount + self.order.real_shipping_charge * 2) - reduce_real_amount
34
34
  end
@@ -6,6 +6,7 @@ module BlsmVdCore
6
6
  has_many :clearing_items, class_name: "::BlsmVdCore::ClearingItem"
7
7
  has_many :line_items, class_name: "::BlsmVdCore::LineItem"
8
8
  belongs_to :application, class_name: "::BlsmVdCore::Application", foreign_key: "application_id"
9
+ belongs_to :shippingorder, class_name: "::BlsmVdCore::Shippingorder", foreign_key: "shippingorder_id"
9
10
  belongs_to :ubox_vm, class_name: "::BlsmVdCore::UboxVm", foreign_key: 'ubox_vmid', primary_key: 'ubox_vmid'
10
11
 
11
12
  encrypted_id key: 'bYqILlFMZn3xd8Cy'
@@ -0,0 +1,6 @@
1
+ # encoding: utf-8
2
+ module BlsmVdCore
3
+ class Shippingorder < BlsmVdCore::BaseRecord
4
+ self.table_name='shippingorders'
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module BlsmVdCore
2
- VERSION = "0.7.8"
2
+ VERSION = "0.8.0"
3
3
  end
data/lib/blsm-vd-core.rb CHANGED
@@ -25,6 +25,7 @@ require 'blsm-vd-core/model/application'
25
25
  require 'blsm-vd-core/model/setting'
26
26
  require 'blsm-vd-core/model/recharge_spread'
27
27
  require 'blsm-vd-core/model/user_spread'
28
+ require 'blsm-vd-core/model/shippingorder'
28
29
  require 'faraday'
29
30
  require 'blsm-mp-wx'
30
31
 
@@ -74,6 +75,18 @@ module BlsmVdCore
74
75
  return on_order_canceled(order.application.user_id, order_id) if order.application
75
76
  end
76
77
 
78
+ #订单被拒签=>创建shippingorder 拒签的记录
79
+ if order.state.to_s.include?('客户拒签,原件返回')
80
+ shippingorder = Shippingorder.where(:id=>order.shippingorder_id).first
81
+ if shippingorder.blank?
82
+ shippingorder = Shippingorder.create(:refuse_at=>Time.now)
83
+ order.update_attributes(:shippingorder_id=>shippingorder.id)
84
+ else
85
+ shippingorder.update_attributes(:refuse_at=>Time.now)
86
+ end
87
+ return
88
+ end
89
+
77
90
  #在线支付(客户签收,订单完成)=>确认结算项
78
91
  if order.state.to_s.include?('客户签收,订单完成')
79
92
  create_clearing_item(order_id) if order.ubox_order?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blsm-vd-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.8
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-12-02 00:00:00.000000000 Z
12
+ date: 2016-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -195,6 +195,7 @@ files:
195
195
  - lib/blsm-vd-core/model/rc_user.rb
196
196
  - lib/blsm-vd-core/model/recharge_spread.rb
197
197
  - lib/blsm-vd-core/model/setting.rb
198
+ - lib/blsm-vd-core/model/shippingorder.rb
198
199
  - lib/blsm-vd-core/model/ubox_vm.rb
199
200
  - lib/blsm-vd-core/model/user.rb
200
201
  - lib/blsm-vd-core/model/user_spread.rb