raise a Warning if funds in wallet are insufficient for label
This commit is contained in:
parent
6403eb7151
commit
6738c68324
|
@ -123,6 +123,8 @@ class DPDeliveryCarrier(models.Model):
|
||||||
im.clear_positions()
|
im.clear_positions()
|
||||||
position = im.build_position(service.code, im_sender, im_recipient)
|
position = im.build_position(service.code, im_sender, im_recipient)
|
||||||
im.add_position(position)
|
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()
|
r = im.checkoutPNG()
|
||||||
voucher = r.shoppingCart.voucherList.voucher[0]
|
voucher = r.shoppingCart.voucherList.voucher[0]
|
||||||
filename = 'DP'+voucher.voucherId+'.png'
|
filename = 'DP'+voucher.voucherId+'.png'
|
||||||
|
|
Loading…
Reference in New Issue