mirror of
https://github.com/bcomsugi/dasaproject.git
synced 2026-01-09 15:32:38 +07:00
minor bug
This commit is contained in:
parent
f3b54e8d76
commit
6c7a48c5cc
@ -145,18 +145,24 @@ def QBStock(client_socket=None, filename='', searchitems = None):
|
||||
itemInvDict={}
|
||||
for ItemInvRet in ItemInventoryQueryRs:
|
||||
try:
|
||||
# QOH = ItemInvRet.find('QuantityOnHand').text
|
||||
QOH = ItemInvRet.find('QuantityOnHand').text
|
||||
QOSO = ItemInvRet.find('QuantityOnSalesOrder').text
|
||||
QOSO = ItemInvRet.find('QuantityOnSalesOrder')
|
||||
if QOSO != None:
|
||||
QOSO = QOSO.text
|
||||
else:
|
||||
QOSO = 0
|
||||
#txnid = ItemInvRet.find('ListID').text
|
||||
name = ItemInvRet.find('Name').text
|
||||
fullName = ItemInvRet.find('FullName').text
|
||||
# print(name, fullName)
|
||||
itemInvDict[fullName] = [name, int(QOH) - int(QOSO)]
|
||||
print(itemInvDict[name], name, QOH, QOSO)
|
||||
except AttributeError:
|
||||
print(itemInvDict[fullName], name, QOH, QOSO)
|
||||
except AttributeError as e:
|
||||
pass
|
||||
print(" Attribute err")
|
||||
except:
|
||||
print("err")
|
||||
print(" Attribute err:", e)
|
||||
except Exception as e:
|
||||
print("err:", e)
|
||||
checkItemReportQuery(itemInvDict)
|
||||
return itemInvDict
|
||||
|
||||
|
||||
@ -147,11 +147,11 @@ def QBStock(client_socket=None, filename='', searchitems = None):
|
||||
#print("")
|
||||
|
||||
response_string = sessionManager.ProcessRequest(ticket, qbxml_query1)
|
||||
print (f"itemreportquery.py -> {response_string}")
|
||||
# print (f"itemreportquery.py response -> {response_string}")
|
||||
# Disconnect from Quickbooks
|
||||
sessionManager.EndSession(ticket) # Close the company file
|
||||
sessionManager.CloseConnection() # Close the connection
|
||||
print (f"itemreportquery.py -> {response_string}")
|
||||
print (f"itemreportquery.py response -> {response_string}")
|
||||
|
||||
# Parse the response into an Element Tree and peel away the layers of response
|
||||
#QBXML = xml.etree.ElementTree.fromstring(response_string)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user