Commit 7be5e903 authored by Georgios Dagkakis's avatar Georgios Dagkakis

changes in demand planning

parent f1b8b2bd
...@@ -151,8 +151,20 @@ def AllocationRoutine_Final(initialWeek, itemList, itemType, ant): ...@@ -151,8 +151,20 @@ def AllocationRoutine_Final(initialWeek, itemList, itemType, ant):
if itemType == 'order': if itemType == 'order':
if chosenMA == None: if chosenMA == None:
G.OrderResults.append((item['orderID'], item['sp'], item['MAlist'], item['Week'], item['Qty'], item['priority'], chosenMA, oMAlist2, 'NaN', 'NaN', 'None')) G.OrderResults.append((item['orderID'], item['sp'], item['MAlist'], item['Week'], item['Qty'], item['priority'], chosenMA, oMAlist2, 'NaN', 'NaN', 'None'))
mList = ''
for i in range(len(oMAlist2)):
if i>0:
mList += ', '
mList += oMAlist2[i]
G.OrderResultsShort.append((item['orderID'], mList))
else: else:
G.OrderResults.append((item['orderID'], item['sp'], item['MAlist'], item['Week'], item['Qty'], item['priority'], chosenMA, oMAlist2, Results[chosenMA]['lateness'], Results[chosenMA]['earliness'], Results[chosenMA]['Allocation'])) G.OrderResults.append((item['orderID'], item['sp'], item['MAlist'], item['Week'], item['Qty'], item['priority'], chosenMA, oMAlist2, Results[chosenMA]['lateness'], Results[chosenMA]['earliness'], Results[chosenMA]['Allocation']))
mList = ''
for i in range(len(oMAlist2)):
if i>0:
mList += ', '
mList += oMAlist2[i]
G.OrderResultsShort.append((item['orderID'], mList))
if itemType == 'forecast': if itemType == 'forecast':
if chosenMA == None: if chosenMA == None:
......
...@@ -81,6 +81,8 @@ class G: ...@@ -81,6 +81,8 @@ class G:
reportResults = tablib.Databook() reportResults = tablib.Databook()
OrderResults = tablib.Dataset(title='OrderSummary') OrderResults = tablib.Dataset(title='OrderSummary')
OrderResults.headers = ('OrderID', 'SP_NUMBER', 'MA_LIST', 'REQUEST_DATE', 'ORDERQTY', 'PRIORITY', 'CHOSEN_MA','ORDERED_MA_LIST', 'LATENESS', 'EARLINESS', 'ALLOCATION') OrderResults.headers = ('OrderID', 'SP_NUMBER', 'MA_LIST', 'REQUEST_DATE', 'ORDERQTY', 'PRIORITY', 'CHOSEN_MA','ORDERED_MA_LIST', 'LATENESS', 'EARLINESS', 'ALLOCATION')
OrderResultsShort = tablib.Dataset(title='OrderResultsForDM')
OrderResultsShort.headers = ('OrderID', 'MA_LIST')
forecastResults = tablib.Dataset(title='ForecastSummary') forecastResults = tablib.Dataset(title='ForecastSummary')
forecastResults.headers = ('PPOS', 'SP_NUMBER', 'MA_LIST', 'REQUEST_DATE', 'ORDERQTY', 'PRIORITY', 'CHOSEN_MA', 'LATENESS', 'EARLINESS', 'ALLOCATION') forecastResults.headers = ('PPOS', 'SP_NUMBER', 'MA_LIST', 'REQUEST_DATE', 'ORDERQTY', 'PRIORITY', 'CHOSEN_MA', 'LATENESS', 'EARLINESS', 'ALLOCATION')
globalMAAllocation = {} globalMAAllocation = {}
...@@ -151,6 +153,8 @@ def initialiseVar(): ...@@ -151,6 +153,8 @@ def initialiseVar():
G.reportResults = tablib.Databook() G.reportResults = tablib.Databook()
G.OrderResults = tablib.Dataset(title='OrderSummary') G.OrderResults = tablib.Dataset(title='OrderSummary')
G.OrderResults.headers = ('OrderID', 'SP_NUMBER', 'MA_LIST', 'REQUEST_DATE', 'ORDERQTY', 'PRIORITY', 'CHOSEN_MA','ORDERED_MA_LIST', 'LATENESS', 'EARLINESS', 'ALLOCATION') G.OrderResults.headers = ('OrderID', 'SP_NUMBER', 'MA_LIST', 'REQUEST_DATE', 'ORDERQTY', 'PRIORITY', 'CHOSEN_MA','ORDERED_MA_LIST', 'LATENESS', 'EARLINESS', 'ALLOCATION')
G.OrderResultsShort = tablib.Dataset(title='OrderResultsForDM')
G.OrderResultsShort.headers = ('OrderID', 'MA_LIST')
G.forecastResults = tablib.Dataset(title='ForecastSummary') G.forecastResults = tablib.Dataset(title='ForecastSummary')
G.forecastResults.headers = ('PPOS', 'SP_NUMBER', 'MA_LIST', 'REQUEST_DATE', 'ORDERQTY', 'PRIORITY', 'CHOSEN_MA', 'LATENESS', 'EARLINESS', 'ALLOCATION') G.forecastResults.headers = ('PPOS', 'SP_NUMBER', 'MA_LIST', 'REQUEST_DATE', 'ORDERQTY', 'PRIORITY', 'CHOSEN_MA', 'LATENESS', 'EARLINESS', 'ALLOCATION')
G.CapacityResults = None G.CapacityResults = None
......
...@@ -60,6 +60,7 @@ def outputResults(): ...@@ -60,6 +60,7 @@ def outputResults():
G.reportResults.add_sheet(resultsOverview) G.reportResults.add_sheet(resultsOverview)
G.reportResults.add_sheet(G.OrderResults) G.reportResults.add_sheet(G.OrderResults)
G.reportResults.add_sheet(G.OrderResultsShort)
G.reportResults.add_sheet(G.forecastResults) G.reportResults.add_sheet(G.forecastResults)
# report capacity results # report capacity results
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment