mirror of
https://github.com/bcomsugi/dasaproject.git
synced 2026-01-09 15:32:38 +07:00
bug fix
This commit is contained in:
parent
4f527d458a
commit
13479cf375
@ -1,6 +1,6 @@
|
||||
cd "C:\Sources\dasaproject\"
|
||||
echo already cd
|
||||
cmd /k "cd /d C:\Sources\dasaproject\env\Scripts\ & activate & cd /d C:\Sources\dasaproject\ & uvicorn main:app --host 0.0.0.0 --port 9999
|
||||
cmd /k "cd /d C:\Sources\dasaproject\env\Scripts\ & activate & cd /d C:\Sources\dasaproject\ & uvicorn main:app --host 0.0.0.0 --port 9979
|
||||
echo workon env
|
||||
echo pause
|
||||
echo get to env
|
||||
|
||||
@ -4,8 +4,9 @@ import win32com.client
|
||||
import xml.etree.ElementTree as ET
|
||||
import itemreportquery as irq
|
||||
|
||||
def QBStock(client_socket=None, filename='', searchitems = {}):
|
||||
|
||||
def QBStock(client_socket=None, filename='', searchitems = None):
|
||||
if searchitems is None:
|
||||
searchitems = {}
|
||||
# Connect to Quickbooks
|
||||
sessionManager = win32com.client.Dispatch("QBXMLRP2.RequestProcessor")
|
||||
sessionManager.OpenConnection('', 'DASA')
|
||||
|
||||
@ -3,7 +3,9 @@ import win32com.client
|
||||
#from win32com.client import constants
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
def QBStock(client_socket=None, filename='', searchitems = {}):
|
||||
def QBStock(client_socket=None, filename='', searchitems = None):
|
||||
if searchitems is None:
|
||||
searchitems = {}
|
||||
|
||||
# Connect to Quickbooks
|
||||
sessionManager = win32com.client.Dispatch("QBXMLRP2.RequestProcessor")
|
||||
@ -100,8 +102,9 @@ def QBStock(client_socket=None, filename='', searchitems = {}):
|
||||
#TxnTypeFilter = createSubElement(ET, ReportTxnTypeFilter, "TxnTypeFilter","All")
|
||||
|
||||
# if you have searchitems then loop here
|
||||
print(f"awal searchitems itemreportquery -> {searchitems}")
|
||||
if searchitems:
|
||||
print(searchitems)
|
||||
print(f"searchitems itemreportquery -> {searchitems}")
|
||||
for searchitem in searchitems:
|
||||
FullName = createSubElement(ET, ReportItemFilter, "FullName", searchitem,6)
|
||||
|
||||
@ -139,16 +142,16 @@ def QBStock(client_socket=None, filename='', searchitems = {}):
|
||||
#print (qbxml_query, type(qbxml_query))
|
||||
print("")
|
||||
|
||||
#print(qbxml_query1, type(qbxml_query1))
|
||||
print(qbxml_query1, type(qbxml_query1))
|
||||
|
||||
#print("")
|
||||
|
||||
response_string = sessionManager.ProcessRequest(ticket, qbxml_query1)
|
||||
|
||||
print (f"itemreportquery.py -> {response_string}")
|
||||
# Disconnect from Quickbooks
|
||||
sessionManager.EndSession(ticket) # Close the company file
|
||||
sessionManager.CloseConnection() # Close the connection
|
||||
#print (response_string)
|
||||
print (f"itemreportquery.py -> {response_string}")
|
||||
|
||||
# Parse the response into an Element Tree and peel away the layers of response
|
||||
#QBXML = xml.etree.ElementTree.fromstring(response_string)
|
||||
@ -167,7 +170,8 @@ def QBStock(client_socket=None, filename='', searchitems = {}):
|
||||
#print(GeneralSummaryReportQueryRs) Cannot use this. Result : None
|
||||
#print("")
|
||||
DataRow = QBXML.iter("DataRow")
|
||||
|
||||
print(f"itemreportquery -> {DataRow}")
|
||||
print("Hello")
|
||||
for ItemInvRet in DataRow:
|
||||
try:
|
||||
Rowdata = ItemInvRet.find("RowData")
|
||||
|
||||
@ -141,7 +141,7 @@ def handle_offline_request(client_socket, lists):
|
||||
if __name__ == '__main__':
|
||||
#xyz={"TH-001aa":"","ECO-016":"","th-002":"","ECO:0:ECO-002":""}
|
||||
xyz={"ECO:0:ECO-002":"","TIERO:R, WY, SU, CM, DM, TR, TM:TI-X-0095-DM":""}
|
||||
xyz={'"TIERO:R, WY, SU, CM, DM, TR, TM:TI-X-0095-DM"':''}
|
||||
# xyz={'"TIERO:R, WY, SU, CM, DM, TR, TM:TI-X-0095-DM"':''}
|
||||
print ("searchitems", xyz)
|
||||
responseRt = searchStockQB(searchitems=xyz)
|
||||
print(responseRt)
|
||||
|
||||
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
Loading…
Reference in New Issue
Block a user