def nota(tableList, opt_perihal, imageList): today = getNow() # 1.interpolasi nomor nota thisMonth = today.strftime('%m') romanizing = rome(thisMonth) notaYear = today.strftime('%Y') nomerNota = tableList[0] noNota = '{0}/PLP-MNJ/{1}/{2}'.format(nomerNota, romanizing, notaYear) tempatTanggal = 'Jakarta, {0}'.format(today.strftime('%d %B %Y')) #docPath = "..\..\\template\\nota\\NOTA.docx" #doc = docx.Document(docPath) #doc.paragraphs[0].runs[3].text = noNota del tableList[0] # 2.interpolasi Perihal (conditional) # 2.1 trip number baru if opt_perihal == 'Trip Number tanpa LO': perihal = 'Ada pengisian yang menyebabkan Temperature is inconsistent with given Temperature in Metered Qty sehingga harus dibuatkan trip number baru dengan data sebagai berikut : ' #doc.paragraphs[7].text = tripBaru pdFile = toDocx(nomerNota, noNota, perihal, tableList, tempatTanggal, imageList) fromAddr, toAddr, pswd = eAddress('PLP_NOTA') msg = mailContentNota(pdFile, nomerNota) logIn(fromAddr, toAddr, pswd, msg) # 2.2 MT ASU elif opt_perihal == 'MT UNIK': mobilAsu = tableList[1] perihal = 'Terdapat pengisian pada MT {0} (MT Unik) yang menyebabkan schedule tersebut tidak dapat masuk secara otomatis ke Omega:'.format( mobilAsu) #doc.paragraphs[7].text = mtAsu pdFile = toDocx(nomerNota, noNota, perihal, tableList, tempatTanggal, imageList) fromAddr, toAddr, pswd = eAddress('PLP_NOTA') #test msg = mailContentNota(pdFile, nomerNota) logIn(fromAddr, toAddr, pswd, msg) # 2.3 DO pecah di bawah kapasitas elif opt_perihal == 'DO Pecah': noMT = tableList[1] perihal = 'Terdapat pengisian do pecah dibawah kapasitas pada MT {0}, yang menyebabkan schedule tersebut tidak dapat masuk secara otomatis ke Omega :'.format( noMT) #doc.paragraphs[7].text = doPe pdFile = toDocx(nomerNota, noNota, perihal, tableList, tempatTanggal, imageList) fromAddr, toAddr, pswd = eAddress('PLP_NOTA') msg = mailContentNota(pdFile, nomerNota) logIn(fromAddr, toAddr, pswd, msg) # 2.4 Konsinyasi dan Reservasi elif opt_perihal == 'Konservasi': perihal = 'Terdapat pengisian konsinyasi/reservasi yang menyebabkan schedule tersebut tidak dapat masuk secara otomatis ke MPV :' #doc.paragraphs[7].text = konservasi pdFile = toDocx(nomerNota, noNota, perihal, tableList, tempatTanggal, imageList) fromAddr, toAddr, pswd = eAddress('PLP_NOTA') msg = mailContentNota(pdFile, nomerNota) logIn(fromAddr, toAddr, pswd, msg)
def jbbReport(likeRightNow): fromAddr, toAddr, pswd = eAddress('JBB') imapObj = logInRead(fromAddr,pswd) DLOPath,outPath,planPath = downMail(imapObj,likeRightNow) subs = 'JBB Closing %s' % likeRightNow msg = mailContent2(subs,DLOPath,outPath,planPath) logIn(fromAddr,toAddr,pswd,msg)
def exeJbb(): if cats.get() == 'TODAY': site = 'BLG' strObjd = getNow() fromAddr, toAddr, pswd = eAddress(site) subs = 'JBB Closing %s' % strObjd.strftime('%d-%m-%Y') msg = mailContent(site, subs, pathEntry7.get(), cats.get()) logIn(fromAddr, toAddr, pswd, msg) pathEntry7.delete(0, END) elif cats.get() == 'YESTERDAY': site = 'BLG' strObjd = getYesterday() fromAddr, toAddr, pswd = eAddress(site) subs = 'JBB Closing %s' % strObjd.strftime('%d-%m-%Y') msg = mailContent(site, subs, pathEntry7.get(), cats.get()) logIn(fromAddr, toAddr, pswd, msg) pathEntry7.delete(0, END)
def sendLO(textPath5, textPath6): today = getNow() thisHour = today.strftime('%H') #make data LO and LO open loOpen(thisHour, textPath6) dataLO(thisHour, textPath5) #mail thingy fromAddr, toAddr, pswd = eAddress('PLP_LO') msg = content(textPath5, textPath6) logIn(fromAddr, toAddr, pswd, msg)