Browse Source

raise a Warning if funds in wallet are insufficient for label

for/master
Harald Welte 5 years ago
parent
commit
6738c68324
  1. 2
      models/dp_delivery_carrier.py

2
models/dp_delivery_carrier.py

@ -123,6 +123,8 @@ class DPDeliveryCarrier(models.Model):
im.clear_positions()
position = im.build_position(service.code, im_sender, im_recipient)
im.add_position(position)
if im.wallet_balance < im.compute_total():
raise Warning("Wallet balance %f is less than label cost %f!" % (im.wallet_balance/100, im.compute_total()/100)
r = im.checkoutPNG()
voucher = r.shoppingCart.voucherList.voucher[0]
filename = 'DP'+voucher.voucherId+'.png'

Loading…
Cancel
Save