mirror of
https://github.com/bcomsugi/dasaproject.git
synced 2026-01-10 17:12:38 +07:00
InventoryStockStatusByVendor updated
This commit is contained in:
parent
99f75ce012
commit
b1f313f4fe
@ -1095,11 +1095,11 @@ class InvoiceQuery(baseQBQuery):
|
|||||||
|
|
||||||
|
|
||||||
@timing
|
@timing
|
||||||
def InventoryStockStatusByVendor() -> dict:
|
def InventoryStockStatusByVendor(ReportEntityFilter_FullName:str='TACO') -> dict:
|
||||||
# g= GeneralSummaryReportQuery(debug=False, GeneralSummaryReportType="ProfitAndLossStandard", ReportDateMacro="ThisYear")
|
# g= GeneralSummaryReportQuery(debug=False, GeneralSummaryReportType="ProfitAndLossStandard", ReportDateMacro="ThisYear")
|
||||||
g= GeneralSummaryReportQuery(debug=False, GeneralSummaryReportType="InventoryStockStatusByVendor", ReportEntityFilter_FullName='TACO', )
|
g= GeneralSummaryReportQuery(debug=False, GeneralSummaryReportType="InventoryStockStatusByVendor", ReportEntityFilter_FullName=ReportEntityFilter_FullName, )
|
||||||
# g= GeneralSummaryReportQuery(debug=False, GeneralSummaryReportType="InventoryStockStatusByVendor", ReportItemFilter_FullName=['TACH:RLC:BBS009PO45-500','TACH:RLC:BBS009PO45-400'], ReportEntityFilter_FullName='TACO' )
|
# g= GeneralSummaryReportQuery(debug=False, GeneralSummaryReportType="InventoryStockStatusByVendor", ReportItemFilter_FullName=['TACH:RLC:BBS009PO45-500','TACH:RLC:BBS009PO45-400'], ReportEntityFilter_FullName='TACO' )
|
||||||
print(g, type(g))
|
# print(g, type(g))
|
||||||
# print(type(g.all()))
|
# print(type(g.all()))
|
||||||
# print(g.all())
|
# print(g.all())
|
||||||
# print(g.response_string)
|
# print(g.response_string)
|
||||||
@ -1113,17 +1113,32 @@ def InventoryStockStatusByVendor() -> dict:
|
|||||||
# pprint.pprint(datarows, sort_dicts=False)
|
# pprint.pprint(datarows, sort_dicts=False)
|
||||||
# print(type(datarows))
|
# print(type(datarows))
|
||||||
dt = {}
|
dt = {}
|
||||||
|
if len(datarows[0]['DataRow'])==0:
|
||||||
|
return dt
|
||||||
for datarow in datarows[0]['DataRow']:
|
for datarow in datarows[0]['DataRow']:
|
||||||
# print(datarow,)
|
# print(datarow,)
|
||||||
FullName=datarow['RowData']['@value']
|
FullName=datarow['RowData']['@value']
|
||||||
if len(FullName.split(':'))==3:
|
if len(FullName.split(':'))==3:
|
||||||
ShortName=datarow['ColData'][0]['@value']
|
ShortName=datarow['ColData'][0]['@value']
|
||||||
QOH=datarow['ColData'][2]['@value']
|
QOH, QOSO, QA, UOM, QOPO, min, max, ND = None, None, None, None, None, None, None, None
|
||||||
QOSO=datarow['ColData'][3]['@value']
|
for coldata in datarow['ColData']:
|
||||||
QA=datarow['ColData'][5]['@value']
|
if coldata['@colID']=='5':
|
||||||
UOM=datarow['ColData'][6]['@value']
|
QOH=coldata['@value']
|
||||||
QOPO=datarow['ColData'][8]['@value']
|
elif coldata['@colID']=='6':
|
||||||
dt[FullName]={'ShortName':ShortName, 'QOH':QOH, 'QOSO':QOSO, 'QA':QA, 'QOPO':QOPO, 'UOM':UOM}
|
QOSO=coldata['@value']
|
||||||
|
elif coldata['@colID']=='8':
|
||||||
|
QA=coldata['@value']
|
||||||
|
elif coldata['@colID']=='9':
|
||||||
|
UOM=coldata['@value']
|
||||||
|
elif coldata['@colID']=='11':
|
||||||
|
QOPO=coldata['@value']
|
||||||
|
elif coldata['@colID']=='3':
|
||||||
|
min=coldata['@value']
|
||||||
|
elif coldata['@colID']=='4':
|
||||||
|
max=coldata['@value']
|
||||||
|
elif coldata['@colID']=='13':
|
||||||
|
ND=coldata['@value'] #Next Delivery Date
|
||||||
|
dt[FullName]={'ShortName':ShortName, 'QOH':QOH, 'QOSO':QOSO, 'QA':QA, 'QOPO':QOPO, 'UOM':UOM, 'min':min, 'max':max, 'ND':ND}
|
||||||
# print(f'{dt = }')
|
# print(f'{dt = }')
|
||||||
# print(len(dt))
|
# print(len(dt))
|
||||||
return dt
|
return dt
|
||||||
@ -1140,7 +1155,8 @@ def InventoryStockStatusByVendor() -> dict:
|
|||||||
{'@colID': '9', '@value': 'Roll'}, #base_uom
|
{'@colID': '9', '@value': 'Roll'}, #base_uom
|
||||||
{'@colID': '10', '@value': 'false'},
|
{'@colID': '10', '@value': 'false'},
|
||||||
{'@colID': '11', '@value': '0'}, #QOPO
|
{'@colID': '11', '@value': '0'}, #QOPO
|
||||||
{'@colID': '12', '@value': '0'}, #ReorderPoint
|
{'@colID': '12', '@value': '0'}, #ReorderqTY
|
||||||
|
{'@colID': '13', '@value': '13/04/2022'}, #NextDeliver
|
||||||
{'@colID': '14', '@value': '0'}],
|
{'@colID': '14', '@value': '0'}],
|
||||||
'RowData': {'@rowType': 'item',
|
'RowData': {'@rowType': 'item',
|
||||||
'@value': 'TEDG:P142:EDG-P1251-1/42'}},
|
'@value': 'TEDG:P142:EDG-P1251-1/42'}},
|
||||||
|
|||||||
4
main.py
4
main.py
@ -90,8 +90,8 @@ async def get_inventorystockstatusbyvendor():
|
|||||||
items = InventoryStockStatusByVendor()
|
items = InventoryStockStatusByVendor()
|
||||||
|
|
||||||
if items:
|
if items:
|
||||||
data = json.dumps(items)
|
# data = json.dumps(items)
|
||||||
return data
|
return items
|
||||||
else:
|
else:
|
||||||
return {'Info': f"CANNOT Get InventoryStockStatusByVendor TACO", 'Status':'ERROR', 'msg':items}
|
return {'Info': f"CANNOT Get InventoryStockStatusByVendor TACO", 'Status':'ERROR', 'msg':items}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user