Module: Vpago::ShipmentDecorator

Defined in:
app/models/vpago/shipment_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



3
4
5
# File 'app/models/vpago/shipment_decorator.rb', line 3

def self.prepended(base)
  base.include ::Vpago::Payoutable
end

Instance Method Details

#cost_with_vendor_adjustment_totalObject

there is no commission for shipment yet. so amount that vendor expected is cost + their adjustments.



13
14
15
# File 'app/models/vpago/shipment_decorator.rb', line 13

def cost_with_vendor_adjustment_total
  cost + vendor_adjustment_total
end

#required_payway_payout?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/models/vpago/shipment_decorator.rb', line 7

def required_payway_payout?
  selected_shipping_rate.required_active_payout_profiles.payway.exists?
end

#vendor_adjustment_totalObject



17
18
19
# File 'app/models/vpago/shipment_decorator.rb', line 17

def vendor_adjustment_total
  adjustments.handle_by_vendor.total
end