You are on page 1of 11

def MC_DR_ORACLE_RPRT_Account(strField, strRecord):

strDept = strRecord[44:48]
strAccount = strField.replace('.', '-') + "-" + strDept
MC_DR_ORACLE_RPRT_Account = strAccount
return MC_DR_ORACLE_RPRT_Account
--------------------------------------------def MC_DR_ORACLE_RPRT_Amount(strField, strRecord):
strAmount = strField.replace('<','-')
strAmount = strAmount.replace('>', '')
MC_DR_ORACLE_RPRT_Amount = strAmount
return MC_DR_ORACLE_RPRT_Amount
--------------------------------------------def MC_DR_024_Amount(strField, strRecord):
strDebit = strField.strip()
strFld = strRecord.split(",")
strCredit = strFld[5].strip()
if strDebit <> "0.00":
dblAmt = strDebit
elif strCredit <> "0.00":
dblAmt = "-" + strCredit
return dblAmt
--------------------------------------------def MC_DR_024_Account(strField, strRecord):
strAccount = strField.replace('"','')
return strAccount
--------------------------------------------def MC_SAP_Account(strField, strRecord):
# This is also used for the ICP and SuppDetail dimensions
strAcct = '0000' + strField
strAcct10 = strAcct[-10:]
strFld = strRecord.split(' ') #Tab Delimited
MC_SAP_Account = strAcct10 + '-' + strFld[12]
return MC_SAP_Account
--------------------------------------------def MC_SAP_Function(strField, strRecord):
strAcct = '0000' + strField
strAcct10 = strAcct[-10:]
strFld = strRecord.split(' ')

if strFld[22] == '':
strSubLedger = 'NO_SUBLEDGER'
else:
strSubLedger = strFld[22][2:3]
MC_SAP_Function = strAcct10 + '-' + strFld[12] + '-' + strSubLedger
return MC_SAP_Function
--------------------------------------------def MC_SAP_ProdLine(strField, strRecord):
# strAcct = '0000' + strField
# strAcct10 = strAcct[-10:]
strFld = strRecord.split(' ')
strCoCo = strFld[2]
strSubLedger = strFld[22]
# MC_SAP_ProdLine = strAcct10 + '-' + strFld[12] + '-' + strCoCo + '-' + str
SubLedger[-3:]
MC_SAP_ProdLine = strCoCo + '-' + strSubLedger[-3:]
return MC_SAP_ProdLine
--------------------------------------------def MC_SAP_Reference(strField, strRecord):
strFld = strRecord.split(' ')
strSubLedger = strFld[22]
MC_SAP_Reference = strField + '-' + strSubLedger[:2]
return MC_SAP_Reference
--------------------------------------------def MC_OraclePII_Account(strField, strRecord):
strAcct = "0000" + strField
strAcct9 = strAcct[-9:]
strFld = strRecord.split(" ")
strAnaCode = strFld[6]
MC_OraclePII_Account = strAcct9 + "-" + strAnaCode
if strField == "":
return fdmSkip
else:
return MC_OraclePII_Account
--------------------------------------------def MC_OraclePII_ICP(strField, strRecord):
strAcct = "0000" + strField
strAcct9 = strAcct[-9:]
strFld = strRecord.split(" ")
strAnaCode = strFld[6]
strICP_Fld10 = strFld[9]
strICP_Fld11 = strFld[10]

MC_OraclePII_ICP = strAcct9 + "-" + strAnaCode + "-" + strICP_Fld10 + "-" +


strICP_Fld11
if strField == "":
return fdmSkip
else:
return MC_OraclePII_ICP
--------------------------------------------def MC_OraclePII_Reference(strField, strRecord):
strMgmt = strField
strFld = strRecord.split(" ")
strLegal = strFld[3]
MC_OraclePII_Reference = strLegal + "-" + strMgmt
if strField == "":
return fdmSkip
else:
return MC_OraclePII_Reference
--------------------------------------------def MC_OraclePII_Reference(strField, strRecord):
strMgmt = strField
strFld = strRecord.split(" ")
strLegal = strFld[3]
MC_OraclePII_Reference = strLegal + "-" + strMgmt
if strField == "":
return fdmSkip
else:
return MC_OraclePII_Reference
--------------------------------------------def MC_DR_209_ICP(strField, strRecord):
strAccount = strRecord[68:79]
strICP = strField + "." + strAccount
strNewValue = strICP.replace('.', '-')
return strNewValue
--------------------------------------------def MC_DR_213_Account(strField, strRecord):
#
#
#
#

strRecord = strRecord[0:150]
strRecord = strRecord.replace(' ', '')
strRecord = strRecord.replace('"', "")
strRecord = strRecord.replace("'", "")
strFld = strRecord.split(",")

strAccount = strFld[3] #strField.replace('"','')


strAccount = strRecord[21:44]
return strAccount

--------------------------------------------def MC_DR_213_Amount(strField, strRecord):


#strDebit = strField.strip()
#
strRecord = strRecord[0:150]
#
strRecord = strRecord.replace(' ', '')
#
strRecord = strRecord.replace('"', "")
#
strRecord = strRecord.replace("'", "")
#
#
#
#

strFld = strRecord.split(",")
strDebit = strFld[4] #.replace(' ','')
#strCredit = strFld[5].strip()
strCredit = strFld[5] #.replace(' ', '')
strDebit = strRecord[46:59].replace(' ', '')
strCredit = strRecord[61:73].replace(' ', '')
if strDebit <> "0.00":
dblAmt = strDebit
elif strCredit <> "0.00":
dblAmt = "-" + strCredit
return dblAmt

--------------------------------------------def MC_DR_213_Amount(strField, strRecord):


#strDebit = strField.strip()
#
strRecord = strRecord[0:150]
#
strRecord = strRecord.replace(' ', '')
#
strRecord = strRecord.replace('"', "")
#
strRecord = strRecord.replace("'", "")
#
#
#
#

strFld = strRecord.split(",")
strDebit = strFld[4] #.replace(' ','')
#strCredit = strFld[5].strip()
strCredit = strFld[5] #.replace(' ', '')
strDebit = strRecord[46:59].replace(' ', '')
strCredit = strRecord[61:73].replace(' ', '')
if strDebit <> "0.00":
dblAmt = strDebit
elif strCredit <> "0.00":
dblAmt = "-" + strCredit
return dblAmt

--------------------------------------------def IBSEntity(strField, strRecord):


strSeg = strRecord.split(" ")
strEnt3 = strSeg[2]
strEnt4 = strSeg[3]

if strSeg[0] == "INCOMING":
IBSEntity = strEnt4
else:
IBSEntity = strEnt3
return IBSEntity
--------------------------------------------def MC_DR_OGL_Account(strField, strRecord):
strFld = strRecord.split(" ")
strAC = strFld[3]
strAccount = "APPEND-" + strField + "-" + strAC
return strAccount
--------------------------------------------def MC_DR_OGL_Amount(strField, strRecord):
strFld = strRecord.split(" ")
strCrDr = strFld[4]
lngAmt = str(strField)
if strCrDr == "C":
lngAmt = "-" + lngAmt
return lngAmt
--------------------------------------------def MC_DR_OGL_UD(strField, strRecord):
strAppend = "APPEND-" + strField
return strAppend
--------------------------------------------def MC_DR_ORACLE_RPRT_ICP(strField, strRecord):
MC_DR_ORACLE_RPRT_ICP = strField.replace('.', '-')
return MC_DR_ORACLE_RPRT_ICP
--------------------------------------------def MC_DR_214_Amount(strField, strRecord):
dblAmt = strField #debit field
strFld = strRecord.split(",") #credit is field 6
if strField == "00000000.00":
dblAmt = "-" + strFld[5]
return dblAmt

--------------------------------------------def MC_DR_214_Account(strField, strRecord):


strAccount = strField.replace('"','')
return strAccount
--------------------------------------------def MC_DR_219_Amount(strField, strRecord):
strAmount
strAmount
strAmount
strAmount

=
=
=
=

strField.replace('"','')
strAmount.replace(' ','')
strAmount.replace('(', '-')
strAmount.replace(')', '')

return strAmount
--------------------------------------------def MC_DR_257_Account(strField, strRecord):
strAcct = strField[7:15]
return strAcct
--------------------------------------------def MC_DR_246_Entity(strField, strRecord):
strAcctR3 = strRecord[4:7]
strEntity = strField + '-' + strAcctR3
strNewValue = strEntity.replace('.', '-')
return strNewValue
--------------------------------------------def Replace_Period_Character(strField, strRecord):
strNewValue = strField.replace('.', '-')
return strNewValue
--------------------------------------------def MC_DR_251_Account(strField, strRecord):
strFld = strRecord.split(",")
strF5 = strField
strF6 = '00000' + strFld[5]
strF6 = strF6[-5:]
strF7 = '000' + strFld[6]
strF7 = strF7[-3:]

strAcct = strF5 + '-' + strF6 + '-' + strF7


return strAcct
--------------------------------------------def MC_DR_OGL_Amount(strField, strRecord):
strFld = strRecord.split(" ")
strCrDr = strFld[4]
lngAmt = str(strField)
if strCrDr == "C":
lngAmt = "-" + lngAmt
return lngAmt
--------------------------------------------def MC_DR_213_Amount(strField, strRecord):
#strDebit = strField.strip()
#
strRecord = strRecord[0:150]
#
strRecord = strRecord.replace(' ', '')
#
strRecord = strRecord.replace('"', "")
#
strRecord = strRecord.replace("'", "")
#
#
#
#

strFld = strRecord.split(",")
strDebit = strFld[4] #.replace(' ','')
#strCredit = strFld[5].strip()
strCredit = strFld[5] #.replace(' ', '')
strDebit = strRecord[46:59].replace(' ', '')
strCredit = strRecord[61:73].replace(' ', '')
if strDebit <> "0.00":
dblAmt = strDebit
elif strCredit <> "0.00":
dblAmt = "-" + strCredit
return dblAmt

--------------------------------------------def MC_DR_OGL_Amount(strField, strRecord):


strFld = strRecord.split(" ")
strCrDr = strFld[4]
lngAmt = str(strField)
if strCrDr == "C":
lngAmt = "-" + lngAmt
return lngAmt
--------------------------------------------def SCR_IF1249_AMT(strField, strRecord):

#
#
#
#
#

workFld = strField
AMT = workFld.lstrip('"')
AMT = AMT.rstrip('"')
AMT = AMT.replace(',','')
return AMT
strAmount
strAmount
strAmount
strAmount

=
=
=
=

strField.replace('"','')
strAmount.replace(' ','')
strAmount.replace('(', '-')
strAmount.replace(')', '')

return strAmount
--------------------------------------------def SCR_LOG(strField, strRecord):
loginfo('TEST logging')
return strField
--------------------------------------------def SCR_FIX_AMT(strField, strRecord):
if strRecord[:5] == 'Total':
return fdmSkip
else:
strAmount = strField.replace('"','')
strAmount = strAmount.replace(' ','')
strAmount = strAmount.replace('(', '-')
strAmount = strAmount.replace(')', '')
strAmount = strAmount.replace('*', '')
return strAmount
--------------------------------------------def SCR_SKIP_TOTAL_LINE(strField, strRecord):

if strRecord[:5] == 'Total':
return fdmSkip
else:
return strField
--------------------------------------------def TMS_LB_U109_Account(strField, strRecord):
strAccount = '0000' + strField
TMS_LB_U109_Account = 'SA-' + strAccount[-12:]
return TMS_LB_U109_Account

--------------------------------------------def TMS_LB_U109_Function(strField, strRecord):

strFld = strRecord.split(' ') #Tab


strAcct = '0000' + strFld[3] #OGL Account
strAccount = strAcct[-12:]
strFun = strField
if strFun == '':
strFun = '0-0'
if strAcct[:1] < '5':
TMS_LB_U109_Function = strAccount[:1] + '-' + strFun
else:
TMS_LB_U109_Function = strFun
return TMS_LB_U109_Function

--------------------------------------------def SCR_STRIP_DBLQUOTE(strField, strRecord):


strAmount = strField.replace('"','')
# strAmount = strAmount.replace(' ','')
# strAmount = strAmount.replace('(', '-')
# strAmount = strAmount.replace(')', '')
# strAmount = strAmount.replace('*', '')
SCR_STRIP_DBLQUOTE = strAmount
return SCR_STRIP_DBLQUOTE

--------------------------------------------def TMS_OGL_Function(strField, strRecord):


strFld = strRecord.split(' ') #Tab
strAcct = strFld[1] #OGL Account
strFun = strField
if strFun == '':
strFun = '0-0'
if strAcct[:1] < '5':
TMS_OGL_Function = strAcct[:1] + '-' + strFun
else:
TMS_OGL_Function = strFun
return TMS_OGL_Function

--------------------------------------------def TMS_OGL_Account(strField, strRecord):


strFld = strRecord.split(' ') #Tab
strAC = strFld[3]
strAccount = '0000' + strField
TMS_OGL_Account = strAccount[-9:] + '-' + strAC
return TMS_OGL_Account

--------------------------------------------def DTS_OGL_Account(strField, strRecord):


strFld = strRecord.split(' ') #Tab
strAC = strFld[24]
strAcct = '0000' + strField
strAccount = strAcct[-9:]
DTS_OGL_Account = strAccount + '-' + strAC
return DTS_OGL_Account

--------------------------------------------def MC_EntitySkip(strField, strRecord):


strLoc = fdmContext ["LOCNAME"]
strCoCo = ''
if strLoc.count('M208') == 1:
strCoCo = '-LB_M208'
if strLoc.count('M406') == 1:
strCoCo = '-LB_M406'
if strLoc == 'MC_ORASI_NW1_FM':
if strField == 'CUK':
strCoCo = '-LB_M208'
if strLoc == 'MC_ORASI_NW2_FM':
if strField == 'CUK':
strCoCo = '-LB_M406'
strFld = strRecord.split(" ")
blnSkip = ''
if strField == "":
blnSkip = 'True'
if strFld[1] =="":
blnSkip = 'True'
if blnSkip == 'True':
return fdmSkip
else:
return strField + strCoCo

--------------------------------------------def MC_SAP_ACCT(strField, strrecord):


return strField[:4]
---------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------