Total Sums are now colored on Summary Sheet. Made changes to Production cost and Adjustment columns in Summary Tab. Now pulls in Item cost from Item Detail tab and sums all production charges in the order. Adjustment is balance due - production - shipping. This matches the original SFU. Minus column widths not being autoset(I'm still researching this) it seems to be on par with the original version.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
from openpyxl.styles import Font
|
from openpyxl.styles import Font
|
||||||
from openpyxl.styles import PatternFill
|
from openpyxl.styles import PatternFill
|
||||||
from openpyxl.styles import numbers
|
# from openpyxl.styles import numbers
|
||||||
|
|
||||||
bold = Font(bold=True)
|
bold = Font(bold=True)
|
||||||
|
|
||||||
@@ -72,16 +72,15 @@ def Save_Report(wb, sheet, sheet2, sheet3, SSheader, columnFormat):
|
|||||||
itemlength = sheet2.max_row
|
itemlength = sheet2.max_row
|
||||||
productlength = sheet3.max_row
|
productlength = sheet3.max_row
|
||||||
|
|
||||||
lightGreen = Font(color='006400')
|
lightGreen = 'ADFF2F'
|
||||||
darkGreen = PatternFill(bgColor="228B22", fill_type="solid")
|
darkGreen = '006400'
|
||||||
|
|
||||||
sheet.cell(column = 5, row=summarylength+1, value="=SUM(E2:E"+str(summarylength)+")")
|
sheet.cell(column = 5, row=summarylength+1, value="=SUM(E2:E"+str(summarylength)+")")
|
||||||
sheet.cell(column = 6, row=summarylength+1, value="=SUM(F2:F"+str(summarylength)+")")
|
sheet.cell(column = 6, row=summarylength+1, value="=SUM(F2:F"+str(summarylength)+")")
|
||||||
sheet.cell(column = 7, row=summarylength+1, value="=SUM(G2:G"+str(summarylength)+")")
|
sheet.cell(column = 7, row=summarylength+1, value="=SUM(G2:G"+str(summarylength)+")")
|
||||||
sheet.cell(column = 8, row=summarylength+1, value="=SUM(H2:H"+str(summarylength)+")")
|
sheet.cell(column = 8, row=summarylength+1, value="=SUM(H2:H"+str(summarylength)+")")
|
||||||
# thisCell = str(summarylength+1)
|
sheet.cell(column = 8, row = summarylength+1).fill = PatternFill(start_color=lightGreen, end_color=darkGreen, fill_type='solid')
|
||||||
# sheet[thisCell].Font = lightGreen
|
sheet.cell(column = 8, row= summarylength+1).font = Font(color=darkGreen)
|
||||||
# sheet[thisCell].PatternFill = darkGreen
|
|
||||||
|
|
||||||
sheet2.cell(column=7, row=itemlength + 1, value="=SUM(G2:G" + str(itemlength)+")")
|
sheet2.cell(column=7, row=itemlength + 1, value="=SUM(G2:G" + str(itemlength)+")")
|
||||||
sheet2.cell(column=8, row=itemlength + 1, value="=SUM(H2:H" + str(itemlength)+")")
|
sheet2.cell(column=8, row=itemlength + 1, value="=SUM(H2:H" + str(itemlength)+")")
|
||||||
@@ -130,6 +129,7 @@ def Save_Report(wb, sheet, sheet2, sheet3, SSheader, columnFormat):
|
|||||||
for cell in sheet3["1:1"]:
|
for cell in sheet3["1:1"]:
|
||||||
cell.font = bold
|
cell.font = bold
|
||||||
|
|
||||||
|
|
||||||
# print("Enter a filename for the report: ")
|
# print("Enter a filename for the report: ")
|
||||||
# filename = input()
|
# filename = input()
|
||||||
wb.save('report.xlsx')
|
wb.save('report.xlsx')
|
||||||
|
|||||||
9
main.py
9
main.py
@@ -159,15 +159,20 @@ def Run_Report(ticket, URL, HOST, REPORT_FIELDS, wb, ws, ws2, DETAIL_REPORT_FIEL
|
|||||||
ws.cell(column=6, row=count+1, value=x)
|
ws.cell(column=6, row=count+1, value=x)
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|
||||||
# Compute Production Charges and write to spreadsheet
|
# Production and Adjustment Charges
|
||||||
count = 1
|
count = 1
|
||||||
for row in ws:
|
for row in ws:
|
||||||
if count != 1:
|
if count != 1:
|
||||||
value = "=H" + str(count) + "-G" + str(count) + "-F" + str(count)
|
|
||||||
|
# value = "=SUMIF(A:A,'Item Detail'!A:A,'Item Detail'!H:H)"
|
||||||
|
value = "=SUMIF('item Detail'!A:A,A" + str(count) + ",'Item Detail'!H:H)"
|
||||||
ws.cell(column=5, row=count, value=value)
|
ws.cell(column=5, row=count, value=value)
|
||||||
|
value = "=H" + str(count) + "-E" + str(count) + "-F" + str(count)
|
||||||
|
ws.cell(column=7, row=count, value = value)
|
||||||
if count < ws.max_row:
|
if count < ws.max_row:
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
|
|
||||||
############# Order Details tab #############
|
############# Order Details tab #############
|
||||||
|
|
||||||
print("Getting Item Detail")
|
print("Getting Item Detail")
|
||||||
|
|||||||
Reference in New Issue
Block a user