| Line 35... |
Line 35... |
| 35 |
Order, BatchNoGenerator, InvoiceIDGenerator, TransactionRequiringExtraProcessing, \
|
35 |
Order, BatchNoGenerator, InvoiceIDGenerator, TransactionRequiringExtraProcessing, \
|
| 36 |
OrderInventory, Alert, PaymentSettlement, EBSSettlementSummary, \
|
36 |
OrderInventory, Alert, PaymentSettlement, EBSSettlementSummary, \
|
| 37 |
CodVerificationAgent, Attribute, RechargeVoucherTracker, EmiScheme, MiscCharges, \
|
37 |
CodVerificationAgent, Attribute, RechargeVoucherTracker, EmiScheme, MiscCharges, \
|
| 38 |
BlockedIpRange, DeniedIpAddress, InsuranceDetailForOrder, DocumentStore, \
|
38 |
BlockedIpRange, DeniedIpAddress, InsuranceDetailForOrder, DocumentStore, \
|
| 39 |
RechargeTransaction, HotspotStore, WalletForCompany, WalletHistoryForCompany, \
|
39 |
RechargeTransaction, HotspotStore, WalletForCompany, WalletHistoryForCompany, \
|
| 40 |
FRC, OperatorSeries, SourceDetail
|
40 |
FRC, OperatorSeries, SourceDetail, Company
|
| 41 |
from shop2020.model.v1.order.impl.model.BaseOrder import BaseOrder
|
41 |
from shop2020.model.v1.order.impl.model.BaseOrder import BaseOrder
|
| 42 |
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
|
42 |
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
|
| 43 |
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
|
43 |
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
|
| 44 |
MobileRechargeOrder
|
44 |
MobileRechargeOrder
|
| 45 |
from shop2020.model.v1.order.impl.model.RechargeDenomination import \
|
45 |
from shop2020.model.v1.order.impl.model.RechargeDenomination import \
|
| Line 4993... |
Line 4993... |
| 4993 |
session.commit()
|
4993 |
session.commit()
|
| 4994 |
return toReturn
|
4994 |
return toReturn
|
| 4995 |
else:
|
4995 |
else:
|
| 4996 |
return toReturn
|
4996 |
return toReturn
|
| 4997 |
|
4997 |
|
| - |
|
4998 |
def topup_company_wallet(companyId, amount):
|
| - |
|
4999 |
wallet = WalletForCompany.query.filter(WalletForCompany.id == companyId).with_lockmode("update").one()
|
| - |
|
5000 |
company = Company.get_by(id = companyId)
|
| - |
|
5001 |
wh = WalletHistoryForCompany()
|
| - |
|
5002 |
wh.walletId = wallet.id
|
| - |
|
5003 |
wh.openingBal = wallet.amount
|
| - |
|
5004 |
wh.closingBal = wallet.amount + amount
|
| - |
|
5005 |
wh.amount = amount
|
| - |
|
5006 |
wh.transactionTime = datetime.datetime.now()
|
| - |
|
5007 |
wh.referenceNumber = get_next_invoice_number(OrderType.WALLETCREDIT)
|
| - |
|
5008 |
wh.description = "Wallet Credited"
|
| - |
|
5009 |
|
| - |
|
5010 |
wallet.amount += amount
|
| - |
|
5011 |
session.commit()
|
| - |
|
5012 |
mail("cnc.center@shop2020.in", "5h0p2o2o", ["rajveer.singh@shop2020.in", "anupam.singh@shop2020.in", "Ashwani.Kumar@spiceretail.co.in","parveen.mittal@spiceretail.co.in","pardeep.panwar@spiceretail.co.in","gagan.sharma@spiceretail.co.in","j.p.gupta@shop2020.in", "rajneesh.arora@shop2020.in", "amit.tyagi@spiceretail.co.in"] , company.name + " wallet topped up by " + str(amount) + " rupees.", "", [], [], [])
|
| - |
|
5013 |
return wallet.amount
|
| - |
|
5014 |
|
| - |
|
5015 |
def get_wallet_balance_for_company(companyId):
|
| - |
|
5016 |
return WalletForCompany.get_by(companyId = companyId).amount
|
| 4998 |
|
5017 |
|
| 4999 |
if __name__ == '__main__':
|
5018 |
if __name__ == '__main__':
|
| 5000 |
print 'helllo'
|
5019 |
print 'helllo'
|
| 5001 |
|
5020 |
|