# tdir.awk function fixdate(dt) { # change /'s to -'s in dd/mm/yyyy sub("/","-",dt) sub("/","-",dt) return dt } function sanetrim(s) { sub(/^[ \t]*/,"",s) sub(/[ \t]*$/,"",s) gsub(/\047/,"`",s) gsub(/\"/,"",s) return s } function trim5(s) { sub(/^[ \t]*/,"",s) sub(/[ \t]*$/,"",s) return substr(s,5) } function trim(s) { sub(/^[ \t]*/,"",s) sub(/[ \t]*$/,"",s) return s } function clip(s) { sub(/[ \t]*$/,"",s) return s } function fixforfname(s) { gsub(/\//,"+",s) return s } function quote(s) { gsub(/\"/,"\\\"",s) return "\"" s "\"" } #---------------------------------------------------------- # convert MMYYYY MMM_YYYY function MMYYYY_to_billperiod(MMYYYY,sep) { mnthstr[1] = "January" mnthstr[2] = "February" mnthstr[3] = "March" mnthstr[4] = "April" mnthstr[5] = "May" mnthstr[6] = "June" mnthstr[7] = "July" mnthstr[8] = "August" mnthstr[9] = "September" mnthstr[10] = "October" mnthstr[11] = "November" mnthstr[12] = "December" billmm = 0 + substr(MMYYYY,1,2) billyyyy = 0 + substr(MMYYYY,3,4) billsdd = 0 + substr(sdate,1,2) billedd = 0 + substr(edate,1,2) # for back billing output syyyymmdd = sprintf("%04s%02s%02s", billyyyy, billmm, billsdd) eyyyymmdd = sprintf("%04s%02s%02s", billyyyy, billmm, billedd) if ( sep != "" ) sepchar = substr(sep,1,1) else sepchar = " " # create monthtag/billperiod billperiod = substr(mnthstr[billmm],1,3) sepchar billyyyy monthtag = substr(mnthstr[billmm],1,3) "_" billyyyy #for ( billmm = 1; billmm < 12; ++billmm ) { # if ( substr(mnthstr[billmm],1,3) == substr(billperiod,1,3) ) # break #} if ( billmm > 12 ) { printf("FATAL ERROR: BAD billperiod [%s]\n", billperiod) exit 1 } #billyyyy = 0 + substr(billperiod,5,4) #monthtag = sprintf("%s_%d", substr(mnthstr[billmm],1,3), billyyyy) print "MMYYYY = " MMYYYY " billperiod = " billperiod # expanded bill period exbillperiod = sprintf("%s %d", mnthstr[billmm], billyyyy) printf("exbillperiod = %s\n", exbillperiod) } function get_weekday_arr(adate) { print "get_weekday_arr(" adate ")" mm = substr(adate,4,2) yyyy = substr(adate,7,4) calcmd = "cal " mm " " yyyy wdlncnt = 0 while ( (calcmd | getline aline) > 0 ) { ++wdlncnt if ( wdlncnt <= 2 ) continue sun = sprintf("%d", substr(aline,1,2)) mon = sprintf("%d", substr(aline,4,2)) tue = sprintf("%d", substr(aline,7,2)) wed = sprintf("%d", substr(aline,10,2)) thu = sprintf("%d", substr(aline,13,2)) fri = sprintf("%d", substr(aline,16,2)) sat = sprintf("%d", substr(aline,19,2)) if ( sun > 0 ) { aweekday = sprintf("%02d-%02d-%04d", sun, mm, yyyy) weekday_arr[aweekday] = "Sunday" } if ( mon > 0 ) { aweekday = sprintf("%02d-%02d-%04d", mon, mm, yyyy) weekday_arr[aweekday] = "Monday" } if ( tue > 0 ) { aweekday = sprintf("%02d-%02d-%04d", tue, mm, yyyy) weekday_arr[aweekday] = "Tuesday" } if ( wed > 0 ) { aweekday = sprintf("%02d-%02d-%04d", wed, mm, yyyy) weekday_arr[aweekday] = "Wednesday" } if ( thu > 0 ) { aweekday = sprintf("%02d-%02d-%04d", thu, mm, yyyy) weekday_arr[aweekday] = "Thursday" } if ( fri > 0 ) { aweekday = sprintf("%02d-%02d-%04d", fri, mm, yyyy) weekday_arr[aweekday] = "Friday" } if ( sat > 0 ) { aweekday = sprintf("%02d-%02d-%04d", sat, mm, yyyy) weekday_arr[aweekday] = "Saturday" } } close(calcmd) #for ( adate in weekday_arr ) { # print "get weekday_arr[" adate "] = " weekday_arr[adate] #} } function weekday(adate) { aweekday = weekday_arr[adate] if ( aweekday == "" ) { # create weekday array for days in month get_weekday_arr(adate) aweekday = weekday_arr[adate] } return aweekday } function is_weekday(adate) { aweekday = weekday(adate) if ( aweekday == "Sunday" || aweekday == "Saturday" ) return 0 return 1 } #---------------------------------------------------------- function getSERVTYPEdesc(servtype,sid,sundry, batchtypeid, batchtypedesc) { servtypedesc = SERVTYPE_to_SERVTYPEdesc_arr[servtype] if ( servtype == 10 ) { batchtypeid = sid_sundry_to_batchtypeid_arr[sid "|" sundry] batchtypedesc = batchtypeid_to_batchtypedesc_arr[batchtypeid] servtypedesc = batchtypedesc } return servtypedesc } function get_HIERIDx_info(HIERIDx,printflag) { split(HIERIDx, HIERIDx_arr, "|") f = 0 SERVTYPE = HIERIDx_arr[++f] CENTRE = HIERIDx_arr[++f] PROJECT = HIERIDx_arr[++f] SUPPLIER = HIERIDx_arr[++f] INVOICENO = HIERIDx_arr[++f] SUNDRY = HIERIDx_arr[++f] SID = HIERIDx_arr[++f] REC_TYPE = HIERIDx_arr[++f] CHG_CAT = HIERIDx_arr[++f] HIERIDxfrom = HIERIDx_arr[++f] #HIERIDxDUPcount = HIERIDx_arr[++f] HIERIDxDUPcount = "NODUPCOUNT" #SERVTYPEdesc = SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] SERVTYPEdesc = getSERVTYPEdesc(SERVTYPE,SID,SUNDRY) batchtypeid = sid_sundry_to_batchtypeid_arr[SID "|" SUNDRY] batchtypedesc = batchtypeid_to_batchtypedesc_arr[batchtypeid] # tbs customer SHIPTO = CENTRE_to_ShipTo_arr[CENTRE] CUSTOMERcode = ShipTo_to_ShipToCode_arr[SHIPTO] CUSTOMERdesc = ShipTo_to_CustomerDesc_arr[SHIPTO] # tbs group GROUP = grid_to_parentgroupid_arr[CENTRE] GROUPdesc = grid_to_grname3_arr[GROUP] CENTREdesc = CENTRE_to_CENTREdesc_arr[CENTRE] CENTREdesc1 = CENTRE_to_CENTREdesc1_arr[CENTRE] CENTREdesc2 = CENTRE_to_CENTREdesc2_arr[CENTRE] CENTREdesc3 = CENTRE_to_CENTREdesc3_arr[CENTRE] PROJECTdesc = CENTREPROJECT_to_PROJECTdesc_arr[CENTRE "|" PROJECT] PROJECTdesc1 = CENTREPROJECT_to_PROJECTdesc1_arr[CENTRE "|" PROJECT] PROJECTdesc2 = CENTREPROJECT_to_PROJECTdesc2_arr[CENTRE "|" PROJECT] PROJECTdesc3 = CENTREPROJECT_to_PROJECTdesc3_arr[CENTRE "|" PROJECT] # rjs9 centre|project has multiple egrids #EGRID = CENTREPROJECT_to_EGRID_arr[CENTRE "|" PROJECT] EGRID = CENTREPROJECTSID_to_EGRID_arr[CENTRE "|" PROJECT "|" SID] t21_EGRID = EGRID #GGRID = CENTRE_to_GGRID_arr[CENTRE] GGRID = grid_to_parentgroupid_arr[EGRID] t21_GGRID = GGRID t21_SID = SID #t21_SID = "" ## t21 call/switchboard/voicemail #if ( SERVTYPE < 100 || SERVTYPE == 101030 || SERVTYPE == 101047 ) { # t21_SID = SID # if ( split(SID,SID_arr,":") == 2 ) { # EGRID = SID_arr[1] # t21_EGRID = EGRID # t21_SID = SID_arr[2] # } #} CHILDCOUNT = childcount_arr[GGRID] # rjs9- # if called from ld_cde() tascode = "" location = "" user = "" costcentre = "" reportgroupid = "" reportgroupdesc = "" reportorder = "" SEID = SERVTYPE from_tbs = 0 if ( REC_TYPE == "T_CHARGE_SUM" ) { SSGCPStag = SERVTYPE "|" SHIPTO "|" GROUP "|" CENTRE "|" PROJECT "|" SID tascode = SSGCPS_to_tascode_arr[SSGCPStag] location = SSGCPS_to_location_arr[SSGCPStag] user = SSGCPS_to_user_arr[SSGCPStag] costcentre = SSGCPS_to_costcentre_arr[SSGCPStag] reportgroupid = SSGCPS_to_reportgroupid_arr[SSGCPStag] reportgroupdesc = SSGCPS_to_reportgroupdesc_arr[SSGCPStag] reportorder = SSGCPS_to_reportorder_arr[SSGCPStag] SEID = SSGCPS_to_SEID_arr[SSGCPStag] debuginfo = SSGCPS_to_debuginfo_arr[SSGCPStag] from_tbs = 1 } if ( from_tbs == 1 ) { XRENT = HIERIDx_to_rentcost_arr[HIERIDx] XCALL = HIERIDx_to_callcost_arr[HIERIDx] XOTHER = HIERIDx_to_othercost_arr[HIERIDx] XADMIN = HIERIDx_to_admincost_arr[HIERIDx] XTOTAL = HIERIDx_to_totalcost_arr[HIERIDx] } else { XRENT = 0 XCALL = 0 XOTHER = 0 XADMIN = 0 XTOTAL = 0 } #-rjs9 Xtag = "TOTALTBS" "|" SERVTYPE "|" GROUP "|" CENTRE "|" PROJECT "|" SID "|" SUPPLIER "|" INVOICENO "|" SUNDRY "|" CHG_CAT totalcount = totalcount_arr[Xtag] totalduration = totalduration_arr[Xtag] totalcost = totalcost_arr[Xtag] #if ( 0 ) { if ( printflag > 1 ) { printf("\n") printf("get_HIERIDx_info()\n") printf(" HIERIDx = %s\n", HIERIDx) #printf(" HIERIDxDUPcount = %d\n", HIERIDxDUPcount) printf(" SERVTYPE = [(%s)%s]\n", SERVTYPE, SERVTYPEdesc) printf(" SEID = %s\n", SEID) printf(" SHIPTO = [(%s)(%s)%s]\n", SHIPTO, CUSTOMERcode, CUSTOMERdesc) printf(" GROUP = [(%s)%s]\n", GROUP, GROUPdesc) printf(" CENTRE = [(%s)%s]\n", CENTRE, CENTREdesc) printf(" GGRID = %s\n", GGRID) printf(" t21_GGRID = %s\n", t21_GGRID) printf(" CHILDCOUNT = %d\n", CHILDCOUNT) printf(" PROJECT = [(%s)%s]\n", PROJECT, PROJECTdesc) printf(" EGRID = %s\n", EGRID) printf(" t21_EGRID = %s\n", t21_EGRID) printf(" SID = %s\n", SID) printf(" t21_SID = %s\n", t21_SID) printf(" SUPPLIER = %s\n", SUPPLIER) printf(" INVOICENO = %s\n", INVOICENO) printf(" SUNDRY = %s\n", SUNDRY) printf(" REC_TYPE = %s\n", REC_TYPE) printf(" CHG_CAT = %s\n", CHG_CAT) printf(" Xtag = [%s]\n", Xtag) printf(" location = [%s]\n", location) printf(" user = [%s]\n", user) printf(" costcentre = [%s]\n", costcentre) printf(" reportgroupid = [%s]\n", reportgroupid) printf(" reportgroupdesc = [%s]\n", reportgroupdesc) printf(" reportorder = [%s]\n", reportorder) printf(" batchtypeid = [%s]\n", batchtypeid) printf(" batchtypedesc = [%s]\n", batchtypedesc) printf(" XRENT = [%s]\n", XRENT) printf(" XCALL = [%s]\n", XCALL) printf(" XOTHER = [%s]\n", XOTHER) printf(" XADMIN = [%s]\n", XADMIN) printf(" XTOTAL = [%s]\n", XTOTAL) printf(" totalcount = [%s]\n", totalcount) printf(" totalduration = [%s]\n", totalduration) printf(" totalcost = [%s]\n", totalcost) } if ( printflag == 1 ) { printf("get_HIERIDx_info()\n"); printf("%d|(%s)%s (%s)%s %s (%s)%s (%s)%s %s (%s)%s %s %s %s %s %s|%f|%f|%f|%f|TOTAL = %f\n", HIERIDxDUPcount, SHIPTO, CUSTOMERdesc, GROUP, GROUPdesc, GGRID, CENTRE, CENTREdesc, SERVTYPE, SERVTYPEdesc, EGRID, PROJECT, PROJECTdesc, SID, SUPPLIER, invoiceno, sundry, CHG_CAT, XRENT, XCALL, XOTHER, XADMIN, totalcost) } } #---------------------------------------------------------- function test_grid1_belongs_to_grid2( grid1, grid2 ) { #print " test_grid_belongs_to_grid(" grid1 "," grid2 ")" tstgrid = grid1 #print " testing tstgrid = [" tstgrid "]" #if ( tstgrid == grid2 ) # return 1 while ( tstgrid != "" ) { #print " testing tstgrid = [" tstgrid "]" if ( tstgrid == grid2 ) { #print " matched tstgrid = [" tstgrid "]" return 1 } tstgrid = grid_to_parentgroupid_arr[tstgrid] } #print " NO MATCH for grid2 = [" grid2 "]" return 0 } function add_fname_to_fnamelist(fname) { } #---------------------------------------------------------- # onnet ? function is_onnet_mobile(nbr, i) { i = index(nbr,"04") if ( i > 0 ) { realnbr = substr(nbr,i,10) if ( length(realnbr) == 10 ) { #print " is_onnet_mobile() 04 " "nbr=[" nbr "]" " mobile_to_sid_arr[" realnbr "] = [" mobile_to_sid_arr[realnbr] "]" if ( mobile_to_sid_arr[realnbr] != "" ) return 1 } } i = index(nbr,"614") if ( i > 0 ) { realnbr = "0" substr(nbr,i+2,9) if ( length(realnbr) == 10 ) { #print " is_onnet_mobile() 614 " "nbr=[" nbr "]" " mobile_to_sid_arr[" realnbr "] = [" mobile_to_sid_arr[realnbr] "]" if ( mobile_to_sid_arr[realnbr] != "" ) return 1 } } return 0 } function is_onnet_fixed(nbr, i,tnbr) { split(nbr, tmpnbr_arr, " ") tnbr = tmpnbr_arr[1] if ( i > 1 ) tnbr = substr(nbr,i,10) # is an extn if ( dirextn_to_t21site_arr[tnbr] != "" ) { #print " is_onnet_fixed()" " dirextn_to_t21site_arr[" tnbr "] = [" dirextn_to_t21site_arr[tnbr] "]" return 1 } for ( indial in indial_arr ) { if ( match(tnbr, indial) ) { #print " is_onnet_fixed()" " tnbr=[" tnbr "]" " indial=[" indial "]" return 1 } if ( match(tnbr, substr(indial,3)) ) { # without area code #print " is_onnet_fixed()" " tnbr=[" tnbr "]" " substr(" indial ",3)=[" substr(indial,3) "]" return 1 } } return 0 } function is_onnet(nbr,is_onnet) { is_onnet = is_onnet_mobile(nbr) ? "ONNET Mobile" : "" if ( is_onnet == "" ) is_onnet = is_onnet_fixed(nbr) ? "Extension" : "" return is_onnet } #---------------------------------------------------------- # premium 19XXXXxx mobile / 19XXXX... fixed line service ? function is_premium_service(nbr, servtype, i,tnbr) { split(nbr, tmpnbr_arr, " ") tnbr = tmpnbr_arr[1] if ( substr(tnbr,1,1) == "+" ) tndr = substr(tnbr,2) i = match(tnbr,"^19[0-9][0-9][0-9][0-9]") if ( i > 0 ) { # mobile premium 19XXXXxx if ( servtype == "10" && length(tnbr) <= 8 ) { #print " is_premium_service()" " nbr=[" nbr "]" " servtype=[" servtype "]" " tnbr=[" tnbr "]" return 1 } # fixed line 19XXXX... if ( servtype == "1" ) { #print " is_premium_service()" " nbr=[" nbr "]" " servtype=[" servtype "]" " tnbr=[" tnbr "]" return 1 } } return 0 } #---------------------------------------------------------- # apply stripdd and ovrcars to dialled no function rtdialno(siteid,trunklocalid,dialledno) { #print "rtdialno(" siteid "," trunklocalid "," dialledno ")" if ( dialledno == "" ) return dialledno new_dialno = dialledno site_trunk = siteid "|" trunklocalid stripdd = site_trunk_to_stripdd[site_trunk] ovrcar1 = site_trunk_to_ovrcar1[site_trunk] ovrcar1acc = site_trunk_to_ovrcar1acc[site_trunk] ovrcar2 = site_trunk_to_ovrcar2[site_trunk] ovrcar2acc = site_trunk_to_ovrcar2acc[site_trunk] if ( strippdd > 0 ) { new_dialno = substr(dialledno,stripdd + 1) #print "rtdialno stripdd=" stripdd " new_dialno=[" new_dialno "]" " dialledno=[" dialledno "]" } len_ovrcar1acc = length(ovrcar1acc) if ( len_ovrcar1acc > 0 ) { if ( substr(ovrcar1acc,length_ovrcar1acc) == "+" ) --len_ovrcar1acc if ( ovrcar1 != "" && len_ovrcar1acc > 0 && substr(new_dialno,1,len_ovrcar1acc) == substr(ovrcar1acc,1,len_ovrcar1acc) ) { new_dialno = substr(new_dialno,len_ovrcar1acc + 1) #print "rtdialno ovrcar1acc=[" ovrcar1acc "] new_dialno=[" new_dialno "]" " dialledno=[" dialledno "]" return new_dialno } } len_ovrcar2acc = length(ovrcar2acc) if ( len_ovrcar2acc > 0 ) { if ( substr(ovrcar2acc,length_ovrcar2acc) == "+" ) --len_ovrcar2acc if ( ovrcar2 != "" && len_ovrcar2acc > 0 && substr(new_dialno,1,len_ovrcar2acc) == substr(ovrcar2acc,1,len_ovrcar2acc) ) { new_dialno = substr(new_dialno,len_ovrcar2acc + 1) #print "rtdialno ovrcar2acc=[" ovrcar2acc "] new_dialno=[" new_dialno "]" " dialledno=[" dialledno "]" return new_dialno } } #print "rtdialno done new_dialno=[" new_dialno "]" " dialledno=[" dialledno "]" return new_dialno } #---------------------------------------------------------- function create_virtual_user_dist_lists() { # Testing print "SKIPPING PERSONAL reports (needs LDAP auth)" return 0 print "create_virtual_user_dist_lists()" system("date") # Mobile users... for ( mobile in mobile_to_directoryID_arr ) { directoryID = mobile_to_directoryID_arr[mobile] grid = mobile_to_grid_arr[mobile] mob_carrier = mobile_to_mob_carriercode_arr[mobile] mob_name = mobile_to_name_arr[mobile] if ( mob_name == "_blank_" ) mob_name = "BLANK NAME" sid = mobile_to_sid_arr[mobile] if ( (directoryID <= 0 || directoryID == "") && grid == "" ) { print "ERROR: create virtual user dist list: SKIPPING blank directoryID and grid for mobile=" mobile continue } staffid = recordno_to_staffid_arr[directoryID] if ( directoryID > 0 && staffid == "" ) { print "WARNING: create virtual user dist list: SKIPPING blank staffid for mobile=" mobile " directoryID=" directoryID continue } ## use extgroupunique from directory if mobconf grid is not set # t21 dir not used for mobiles - egrid is sid (see groups4) if ( grid == "" ) { #grid = recordno_to_eggrid_arr[directoryID] grid = sid if ( grid == "" ) { print "ERROR: create virtual user dist list: SKIPPING blank directory grid for mobile=" mobile " directoryID=" directoryID continue } } Vdistid = staffid ## Testing #if ( Testing >= 3 && !(Vdistid == "H9500027") ) { # #print "DISTID TESTING... SKIP Vdistid = " Vdistid # continue #} if ( distid_to_distiddesc_arr[Vdistid] == "" ) { print "create Vdistid=[" Vdistid "]" " staffid=[" staffid "]" " directoryID=[" directoryID "]" " grid=[" grid "]" " sid=[" sid "]" " mob_name=[" mob_name "]" distid_to_directoryID_arr[Vdistid] = directoryID Vdistid_to_directoryID_arr[Vdistid] = directoryID distid_to_distiddesc_arr[Vdistid] = "Personal Reports for " mob_name distid_to_t21name_arr[Vdistid] = mob_name distid_to_userid_arr[Vdistid] = staffid distid_to_wbd_method_arr[Vdistid] = "WEB" distid_to_wbd_type_arr[Vdistid] = "PERSONAL" print " distid_to_distiddesc_arr[" Vdistid "]=[" distid_to_distiddesc_arr[Vdistid] "]" } #else { # print "WARNING: Existing distid_to_distiddesc_arr[" Vdistid "] = " distid_to_distiddesc_arr[Vdistid] #} Stag = grid "|" 10 "|" sid personal_egrid_servtype_SID_to_distid_arr[Stag] = Vdistid print "DEBUG: personal_egrid_servtype_SID_to_distid_arr[" Stag "] = " personal_egrid_servtype_SID_to_distid_arr[Stag] distgrid = Vdistid "|" Stag distgrid_arr[distgrid] = 1 } } #---------------------------------------------------------- function create_egrid_distidlist() { print "create_egrid_distidlist()" system("date") for (grid in grid_to_grtype_arr ) { if ( grid_to_grtype_arr[grid] != "E" ) continue for ( DISTID in distid_to_distiddesc_arr ) { # do all grids in distlist for ( dgstr in distgrid_arr ) { split(dgstr, dgstr_arr, "|") if ( DISTID != dgstr_arr[1] ) continue distgrid = dgstr_arr[2] # keep a list of egrids in distids # (see addstar code below) if ( grid_to_grtype_arr[distgrid] == "E" && distgrid == grid ) { distid_egrid_arr[DISTID "|" grid] = 1 } # Vdistid not added to distgrid_arr yet ! #distservtype = dgstr_arr[3] #distsid = dgstr_arr[4] #if ( distservtype != "" || distsid != "" ) { # # skip single servtype/sid # # (personal Vdistid) # continue #} if (test_grid1_belongs_to_grid2(grid, distgrid)) { if ( distid_to_wbd_type_arr[DISTID] == "MANAGEMENT" ) { if ( mng_egrid_distidlist_arr[grid] != "" ) mng_egrid_distidlist_arr[grid] = mng_egrid_distidlist_arr[grid] "|" DISTID else mng_egrid_distidlist_arr[grid] = DISTID } else { if ( egrid_distidlist_arr[grid] != "" ) egrid_distidlist_arr[grid] = egrid_distidlist_arr[grid] "|" DISTID else egrid_distidlist_arr[grid] = DISTID } distid_allegrid_arr[DISTID "|" grid] = 1 } } } } } #---------------------------------------------------------- function get_siteid(extn) { for ( extrngstr in extrange_to_siteid_arr ) { split(extrngstr, extrngstr_arr, "|") #print "getsiteid extn = " extn " extrngstr_arr[1] = " extrngstr_arr[1] " extrngstr_arr[2] = " extrngstr_arr[2] if ( extn >= extrngstr_arr[1] && extn <= extrngstr_arr[2] ) { #print "get_siteid found siteid = " extrange_to_siteid_arr[extrngstr] " for extn = " extn #print " extrngstr_arr[1] = " extrngstr_arr[1] " extrngstr_arr[2] = " extrngstr_arr[2] return extrange_to_siteid_arr[extrngstr] } } return -1 } function get_code1(extn) { for ( extrngstr in extrange_to_code1_arr ) { split(extrngstr, extrngstr_arr, "|") if ( extn >= extrngstr_arr[1] && extn <= extrngstr_arr[2] ) { #print "get_code1 found code1 = " extrange_to_code1_arr[extrngstr] " for extn = " extn #print " extrngstr_arr[1] = " extrngstr_arr[1] " extrngstr_arr[2] = " extrngstr_arr[2] return extrange_to_code1_arr[extrngstr] } } return "" } function get_code2(extn) { for ( extrngstr in extrange_to_code2_arr ) { split(extrngstr, extrngstr_arr, "|") if ( extn >= extrngstr_arr[1] && extn <= extrngstr_arr[2] ) { #print "get_code2 found code2 = " extrange_to_code2_arr[extrngstr] " for extn = " extn #print " extrngstr_arr[1] = " extrngstr_arr[1] " extrngstr_arr[2] = " extrngstr_arr[2] return extrange_to_code2_arr[extrngstr] } } return "" } function nget_code2(extn,code1) { for ( extrngcode1str in extrangecode1_to_code2_arr ) { split(extrngcode1str, extrngcode1str_arr, "|") #print "nget_code2 extn=[" extn "]" " code1=[" code1 "]" " extrngcode1str=[" extrngcode1str "]" #print " extrngcode1str_arr[1] = " extrngcode1str_arr[1] " extrngcode1str_arr[2] = " extrngcode1str_arr[2] " extrngcode1str_arr[3] = " extrngcode1str_arr[3] if ( extn >= extrngcode1str_arr[1] && extn <= extrngcode1str_arr[2] && extrngcode1str_arr[3] == code1 ) { #print "nget_code2 found code2=[" extrangecode1_to_code2_arr[extrngcode1str] "]" return extrangecode1_to_code2_arr[extrngcode1str] } } return "" } #---------------------------------------------------------- #---------------------------------------------------------- function ld_tbsdata_customer(customerfile) { printf("ld_tbsdata_customer(%s)\n", customerfile) #1|NXS|NEGA (SWANSTON TRAMS) PTY LTD|V6050884| # NATIONAL EXPRESS (SWANSTON) PTY LTD| # C/O MCGRATH NICOL - ATT: D PIENING|LEVEL 1; 161 COLLINS STREET| # MELBOURNE|VIC|3000||0|1|1|Dec 07 2004 12:00AM||robynd|1| while ( (getline aline < customerfile) > 0 ) { split(aline, a_arr, "|") ##printf("aline=%s\n", aline) CustomerID = trim(a_arr[1]) ShipTo = trim(a_arr[2]) ShipToDesc = trim(a_arr[3]) ShipToCode = trim(a_arr[4]) ShipToFullDesc = trim(a_arr[5]) ShipTo = toupper(ShipTo) CustomerDesc = ShipToFullDesc #if ( ShipTo == substr(ShipToFullDesc,1,length(ShipTo)) ) # CustomerDesc = substr(ShipToFullDesc,length(ShipTo)+1) if ( substr(CustomerDesc,1,1) == " " ) CustomerDesc = substr(CustomerDesc,2) if ( CustomerDesc != "" ) CustomerDesc = CustomerDesc " - " ShipTo else CustomerDesc = ShipTo ShipTo_to_ShipToDesc_arr[ShipTo] = ShipToDesc ShipTo_to_ShipToCode_arr[ShipTo] = ShipToCode ShipTo_to_CustomerDesc_arr[ShipTo] = CustomerDesc CustomerID_to_ShipTo_arr[CustomerID] = ShipTo print " ShipTo = " ShipTo print " ShipTo_to_ShipToDesc_arr[" ShipTo "] = " ShipTo_to_ShipToDesc_arr[ShipTo] print " ShipTo_to_ShipToCode_arr[" ShipTo "] = " ShipTo_to_ShipToCode_arr[ShipTo] print " CustomerID_to_ShipTo_arr[" CustomerID "] = " CustomerID_to_ShipTo_arr[CustomerID] print " ShipTo_to_CustomerDesc_arr[" ShipTo "] = " ShipTo_to_CustomerDesc_arr[ShipTo] } close(customerfile) } function ld_tbsdata_servicetype(servicetypefile) { printf("ld_tbsdata_servicetype(%s)\n", servicetypefile) #99|XA|SMS MESSAGES|194|140|140|0||0|1|Dec 07 2004 12:00AM| # |1|0|0|0.0000|0| while ( (getline aline < servicetypefile) > 0 ) { split(aline, a_arr, "|") ServiceTypeID = trim(a_arr[1]) ServiceTypeCode = trim(a_arr[2]) SupplierID = trim(a_arr[4]) RevenueElementID = trim(a_arr[5]) SystemID = trim(a_arr[8]) tascode = ServiceTypeCode tascode_to_SystemID_arr[tascode] = SystemID tascode_to_ElementID_arr[tascode] = RevenueElementID tascode_to_orgElementID_arr[tascode] = RevenueElementID tascode_to_SupplierID_arr[tascode] = SupplierID print " tascode = " tascode print " tascode_to_SystemID_arr[" tascode "] = " tascode_to_SystemID_arr[tascode] print " tascode_to_ElementID_arr[" tascode "] = " tascode_to_ElementID_arr[tascode] print " tascode_to_SupplierID_arr[" tascode "] = " tascode_to_SupplierID_arr[tascode] } close(servicetypefile) } function ld_tbsdata_element(elementfile) { printf("ld_tbsdata_element(%s)\n", elementfile) #1|1046|Telco Account Processing Fee||1|1|May 10 2005 12:00AM||499|10|0| while ( (getline aline < elementfile) > 0 ) { split(aline, a_arr, "|") ##printf("aline=%s\n", aline) #printf("a_arr 1=%s 3=%s 4=%s\n", a_arr[1], a_arr[3], a_arr[4]) ElementID = trim(a_arr[1]) ElementCode = trim(a_arr[2]) ElementCodeDesc = trim(a_arr[3]) CustomerID = trim(a_arr[9]) if ( CustomerID != "499" ) # only look at VRT entries continue SGID = 0 SGIDdesc = "All" SEID = ElementCode SEIDdesc = ElementCodeDesc SGID_to_SGIDdesc_arr[SGID] = SGIDdesc SEID_to_SEIDdesc_arr[SEID] = SEIDdesc SEID_to_SGID_arr[SEID] = SGID ElementID_to_SEID_arr[ElementID] = SEID SEID_to_orgElementID_arr[SEID] = ElementID print " SGID = " SGID " SEID = " SEID print " SEID_to_SGID_arr[" SEID "] = " SEID_to_SGID_arr[SEID] print " SGID_to_SGIDdesc_arr[" SGID "] = " SGID_to_SGIDdesc_arr[SGID] print " SEID_to_SEIDdesc_arr[" SEID "] = " SEID_to_SEIDdesc_arr[SEID] print " ElementID_to_SEID_arr[" ElementID "] = " ElementID_to_SEID_arr[ElementID] } close(elementfile) } function ld_tbsdata_supplier(supplierfile) { printf("ld_tbsdata_supplier(%s)\n", supplierfile) #1|OPTUS COMMUNICATIONS|1||robynd|OPT001|1|OPTUS COMMUNICATIONS| # LEVEL 6|50 MILLER STREET|NORTH SYDNEY|NSW|2060| while ( (getline aline < supplierfile) > 0 ) { split(aline, a_arr, "|") ##printf("aline=%s\n", aline) #printf("a_arr 1=%s 7=%s\n", a_arr[1], a_arr[7]) SupplierID = trim(a_arr[1]) SupplierName = trim(a_arr[2]) split(SupplierName, SupplierName_arr, " ") supplier = toupper(SupplierName_arr[1]) SupplierID_to_supplier_arr[SupplierID] = supplier print " SupplierID = " SupplierID print " SupplierName = " SupplierName print " supplier = " supplier print " SupplierID_to_supplier_arr[" SupplierID "] = " SupplierID_to_supplier_arr[SupplierID] } close(supplierfile) } function ld_tbsdata_person(personfile) { printf("ld_tbsdata_person(%s)\n", personfile) while ( (getline aline < personfile) > 0 ) { split(aline, a_arr, "|") #printf("aline=%s\n", aline) f = 0 PersonID = sanetrim(a_arr[++f]) Person = sanetrim(a_arr[++f]) StartDate = sanetrim(a_arr[++f]) EndDate = sanetrim(a_arr[++f]) Active = sanetrim(a_arr[++f]) emailaddress = sanetrim(a_arr[++f]) dirID = "Person" PersonID recordno = dirID master = "Y" t21surname = Person t21firstname = "" staffid = emailaddress # ??? see personservicelist t21division = "ToBeSet" # (ShipTo) t21location = "ToBeSet" t21department = "tbsdept ToBeSet" t21site = "tbssite ToBeSet" extn = "tbsextn ToBeSet" if ( t21surname == "" ) t21surname = "_blank_" if ( t21firstname == "" ) t21firstname = "_blank_" if ( t21location == "" ) t21location = "_blank_" t21name = t21surname if ( t21firstname != "_blank_") t21name = sprintf("%s %s", t21firstname, t21name) recordno_to_master_arr[recordno] = master recordno_to_t21name_arr[recordno] = t21name print " tPerson recordno_to_t21name_arr[" recordno "] = [" recordno_to_t21name_arr[recordno] "]" recordno_to_staffid_arr[recordno] = staffid print " tPerson recordno_to_staffid_arr[" recordno "] = [" recordno_to_staffid_arr[recordno] "]" recordno_to_t21site_arr[recordno] = t21site recordno_to_t21surname_arr[recordno] = t21surname recordno_to_t21firstname_arr[recordno] = t21firstname recordno_to_t21location_arr[recordno] = t21location recordno_to_t21division_arr[recordno] = t21division recordno_to_t21department_arr[recordno] = t21department recordno_to_extn_arr[recordno] = extn } close(personfile) } #----------------------------------------------------------------- # to replace info from Telmax21 Directory function ld_tbsdata_personservicelist(personservicelistfile) { printf("ld_tbsdata_personservicelist(%s)\n", personservicelistfile) while ( (getline aline < personservicelistfile) > 0 ) { split(aline, a_arr, "|") #printf("aline=%s\n", aline) f = 0 PersonID = sanetrim(a_arr[++f]) Person = sanetrim(a_arr[++f]) ServiceIDID = sanetrim(a_arr[++f]) ServiceID = sanetrim(a_arr[++f]) ShipTo = sanetrim(a_arr[++f]) FullName = sanetrim(a_arr[++f]) LocationID = sanetrim(a_arr[++f]) LocationDesc = sanetrim(a_arr[++f]) DepartmentID = sanetrim(a_arr[++f]) DepartmentDesc = sanetrim(a_arr[++f]) dirID = "Person" PersonID recordno = dirID t21division = ShipTo t21location = LocationDesc t21department = DepartmentDesc recordno_to_t21division_arr[recordno] = t21division recordno_to_t21location_arr[recordno] = t21location recordno_to_t21department_arr[recordno] = t21department print " tbspersonservicelist: recordno_to_t21division_arr[" recordno "] = [" recordno_to_t21division_arr[recordno] "]" print " tbspersonservicelist: recordno_to_t21location_arr[" recordno "] = [" recordno_to_t21location_arr[recordno] "]" print " tbspersonservicelist: recordno_to_t21department_arr[" recordno "] = [" recordno_to_t21department_arr[recordno] "]" # a person in tPerson can be against multiple serviceid's # so can't do this ##recordno_to_eggrid_arr[recordno] = extgroupunique #recordno_to_eggrid_arr[recordno] = ServiceID #print " tbspersonservicelist recordno_to_eggrid_arr[" recordno "] = [" recordno_to_eggrid_arr[recordno] "]" # (mobile to person done in gettbsmobconf script) #if ( match(ServiceID,/^04..-......$/) <= 0 ) # mobile = "" #else # mobile = substr(ServiceID,1,2) substr(ServiceID,4) #mobile_to_directoryID_arr[mobile] = dirID #print " mobile_to_directoryID_arr[" mobile "] = " mobile_to_directoryID_arr[mobile] # for m11cdr sid_to_directoryID_arr[ServiceID] = dirID print " tbspersonservicelist: sid_to_directoryID_arr[" ServiceID "]=[" sid_to_directoryID_arr[ServiceID] "]" } close(personservicelistfile) } #----------------------------------------------------------------- #rjs9 #function ld_seidtranslate(seidtranslatefile) { # printf("ld_seidtranslate(%s)\n", seidtranslatefile) # while ( (getline aline < seidtranslatefile) > 0 ) { # split(aline, a_arr, ",") # ##printf("aline=%s\n", aline) # #printf("a_arr 1=%s 7=%s\n", a_arr[1], a_arr[7]) # # systemid = trim(a_arr[1]) # seid = trim(a_arr[2]) # # systemid_to_seid[systemid] = seid # # print "systemid_to_seid[" systemid "] = " systemid_to_seid[systemid] # } # close(seidtranslatefile) #} #----------------------------------------------------------------- function ld_cde(cdefile) { printf("ld_cde(%s)\n", cdefile) while ( (getline aline < cdefile) > 0 ) { gsub("\r","",aline) i = split(aline, a_arr, "|") if ( i != 29 ) { print "WARNING: bad cde record in file " cdefile " [" aline "]" " i=" i continue } print cdefile ": " aline ##printf("aline=[%s]\n", aline) #printf("a_arr 1=%s\n", a_arr[1]) f = 0 shipto = trim(a_arr[++f]) sundry = trim(a_arr[++f]) rentcost = trim(a_arr[++f]) callcost = trim(a_arr[++f]) othercost = trim(a_arr[++f]) admincost = trim(a_arr[++f]) totalcost = trim(a_arr[++f]) batchtypeid = trim(a_arr[++f]) batchtypedesc = trim(a_arr[++f]) reportgroupid = trim(a_arr[++f]) reportgroupdesc = trim(a_arr[++f]) reportorder = trim(a_arr[++f]) tascode = trim(a_arr[++f]) tbsSID = trim(a_arr[++f]) location = trim(a_arr[++f]) user = trim(a_arr[++f]) tbscentreid = trim(a_arr[++f]) tbscentre = trim(a_arr[++f]) activity = trim(a_arr[++f]) element = trim(a_arr[++f]) subledger = trim(a_arr[++f]) paytype = trim(a_arr[++f]) deptid = trim(a_arr[++f]) department = trim(a_arr[++f]) servicedesc = trim(a_arr[++f]) installdate = trim(a_arr[++f]) std = trim(a_arr[++f]) tbsperiod = trim(a_arr[++f]) #-------------------------- SHIPTO = toupper(shipto) # cant have "/" in tbsSID (re: filenames) gsub("/",".",tbsSID) print "SHIPTO=[" SHIPTO "]" " batchtypeid=[" batchtypeid "]" " batchtypedesc=[" batchtypedesc "]" " tbsSID=[" tbsSID "]" sid_sundry_to_batchtypeid_arr[tbsSID "|" sundry] = batchtypeid batchtypeid_to_batchtypedesc_arr[batchtypeid] = batchtypedesc # Testing #if ( Testing >= 3 && index("|ANN|VLP|VLS|VLO|VLI|VNA|VTC|VNE|VSE|VSW|VRT|", "|" SHIPTO "|") <= 0 ) { if ( Testing >= 3 && index("|A|D|K|S|V|", "|" substr(SHIPTO,1,1) "|") <= 0 ) { #print "CDE TESTING... SKIP SHIPTO = " SHIPTO continue } ############################ costcentre = sprintf("%-6.6s %-2.2s %-6.6s %-6.6s %-1.1s", tbscentre, activity, element, subledger, paytype) #ElementID = tascode_to_ElementID_arr[tascode] #print " tascode_to_ElementID_arr[" tascode "] = [" tascode_to_ElementID_arr[tascode] "]" #itag = SHIPTO "|" sundry orgElementID = ElementID = tascode_to_orgElementID_arr[tascode] itag = SHIPTO "|" sundry "|" orgElementID platinv_batch = parent_sundry_to_platinv_batch_arr[itag] print " itag=" itag " platinv_batch = " platinv_batch if ( platinv_batch == "" ) { print "WARNING: Can't get Platinum Invoice batch for SHIPTO = " SHIPTO " sundry = " sundry } # if ShipTo code in tbs Customer is blank then set SHIPTO to VRT if ( ShipTo_to_ShipToCode_arr[SHIPTO] == "" ) { print "WARNING: blank ShiptoCode, setting SHIPTO to VRT" SHIPTO = "VRT" #itag = SHIPTO "|" sundry itag = SHIPTO "|" sundry "|" orgElementID platinv_batch = "VRTBATCHFILENAME" parent_sundry_to_platinv_batch_arr[itag] = platinv_batch invoiceno = "VRT999999" parent_sundry_to_platinv_invoicenumber_arr[itag] = invoiceno } # if ShipTo code in tbs Customer is VRT if ( ShipTo_to_ShipToCode_arr[SHIPTO] == "VRT" ) { print "ShiptoCode = VRT, setting dummy platinv_batch" SHIPTO = "VRT" #itag = SHIPTO "|" sundry itag = SHIPTO "|" sundry "|" orgElementID platinv_batch = "VRTBATCHFILENAME" parent_sundry_to_platinv_batch_arr[itag] = platinv_batch invoiceno = "VRT999999" parent_sundry_to_platinv_invoicenumber_arr[itag] = invoiceno } SupplierID = tascode_to_SupplierID_arr[tascode] #old tassemap supplier = tascode_to_supplier_arr[tascode] supplier = SupplierID_to_supplier_arr[SupplierID] #old tassemap SEID = tascode_to_SEID_arr[tascode] SEID = ElementID_to_SEID_arr[ElementID] print " ElementID_to_SEID_arr[" ElementID "] = [" ElementID_to_SEID_arr[ElementID] "]" orgSEID = ElementID_to_SEID_arr[orgElementID] print "orgSEID = " orgSEID # 05/12/2007 # all internal and external network services for VRT # are now set to seid 2399 in tbsdata seidchange = 0 actualSEID = SEID #if ( SEID == 2399 ) { # do for all (for VoiceMail in non VRT and future) # rjs9- ## for mobile - translate seid using systemid #systemid = tascode_to_SystemID_arr[tascode] #newseid = systemid_to_seid[systemid] #if ( newseid != "" ) { # print " translate SEID=" SEID " translate newseid=" newseid " systemid=" systemid # SEID = newseid # seidchange = 1 #} #else { # # use tbsSID to determine Telmax21 data # newseid = 101043 # if ( grid_to_grtype_arr[tmpsid] == "E" ) { # print " SEID=" SEID " newseid=" newseid " tbsSID=" tbsSID # SEID = newseid # seidchange = 1 # } # else { # test for Switchboard or Voicemail # if ( substr(tbsSID,1,2) == "SW" ) { # tmpsid = substr(tbsSID,3) # newseid = 101030 # } # if ( substr(tbsSID,1,2) == "VM" ) { # tmpsid = substr(tbsSID,3) # newseid = 101047 # } # if (grid_to_grtype_arr[tmpsid] == "E") { # print " SEID=" SEID " newseid=" newseid " tbsSID=" tbsSID " tmpsid=" tmpsid # SEID = newseid # seidchange = 1 # } # } #} # to determine if its a mobile # match tbsSID with 04..-...... if ( seidchange == 0 && match(tbsSID, "04[0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]") ) { # if not #batchtypeid != 141 && # VT Call Diversion #batchtypeid != 304 && # Smartbus BGPRS #batchtypeid != 461 && # Kamco #batchtypeid != 446 && # Smartbus Aggregate if ( batchtypeid != 141 && # VT Call Diversion reportgroupid != 15 && # Smartbus GPRS reportgroupid != 19 && # Smartbus Aggregate 1 == 1 ) { print " mobile - SEID=" SEID " newseid=" newseid " tbsSID=" tbsSID SEID = 101044 seidchange = 1 # set carrier code from supplier name carriercode = tolower(substr(supplier,1,1)) mobile = substr(tbsSID,1,4) substr(tbsSID,6,6) mobile_to_mob_carriercode_arr[mobile] = carriercode print "setcarriercode: mobile_to_mob_carriercode_arr[" mobile "]=[" mobile_to_mob_carriercode_arr[mobile] "]" } } ## to determine if its T21 calls/switchboard/voicemail ## use tascode & tbsSID #if ( seidchange == 0 && index("|TQ|TQ1|TQD|TQQ|TQS|VOI|VS1|VSW|VV1|", "|" tascode "|") > 0 ) { # # T21 calls # newseid = 101043 # # # T21 switchboard # if ( substr(tbsSID,1,2) == "SW" ) # newseid = 101030 # # # T21 voicemail # if ( substr(tbsSID,1,2) == "VM" ) # newseid = 101047 # # SEID = newseid # seidchange = 1 # print " T21 - SEID=" SEID " newseid=" newseid " tbsSID=" tbsSID " tascode=" tascode #} # to determine if it is T21 calls/switchboard/voicemail # use t21egrid lookup t21seid = t21egrid_to_seid_arr[tbsSID] print "t21seid=[" t21seid "]" if (seidchange == 0 && t21seid != "" ) { newseid = t21seid SEID = newseid seidchange = 1 print " T21 - SEID=" SEID " newseid=" newseid " tbsSID=" tbsSID " tascode=" tascode } # -rjs9 #} ## SEID is still 2399 so, ## this is to prevent hardcodes in reports from ## creating drill down to t21 call/rent for ## non drilldown services #if ( SEID == 2399 ) { # SEID = 102399 # SEID_to_SEIDdesc_arr[SEID] = SEID_to_SEIDdesc_arr[2399] # print " no translate for SEID=2399 setto=" SEID " systemid=" systemid # seidchange = 1 #} # set elementid to seid lookup for replaced VRT 2399 seid if ( seidchange == 1 ) { # use replaced SEID+100000 as elementid newelementid = SEID + 100000 tascode_to_ElementID_arr[tascode] = newelementid ElementID_to_SEID_arr[newelementid] = SEID SEID_to_orgElementID_arr[SEID] = ElementID print "new ElementID_to_SEID_arr[" newelementid "] = " ElementID_to_SEID_arr[newelementid] SEID_to_SGID_arr[SEID] = 0 # create seid desc for new seid's set here # preserve switchboard seid desc SEID_to_SEIDdesc_arr[101030] = SEID_to_SEIDdesc_arr[1030] # VOICEMAIL has no entry in tElement SEID_to_SEIDdesc_arr[101047] = "Telco VoiceMail" # preserve mobile seid desc SEID_to_SEIDdesc_arr[101044] = SEID_to_SEIDdesc_arr[1044] # preserve T21 Rent and Calls seid desc SEID_to_SEIDdesc_arr[101043] = SEID_to_SEIDdesc_arr[1043] } SEIDdesc = SEID_to_SEIDdesc_arr[SEID] if ( SEIDdesc == "" ) SEIDdesc = "Blank SEIDdesc" print " use SEID = " SEID " SEIDdesc = [" SEIDdesc "]" print " tascode=" tascode " supplier=" supplier # store sundry for T21 calls if ( tbsperiod == TBSBillingPeriod && # current period only supplier == t21_supplier && # Victrack SEID == 101043 ) { # T21 calls # save TIMS calls sundry for each tbsSID if ( t21_sundry != "" && t21_sundry != sundry ) { print "FATAL ERROR: multiple TIMS calls Sundrys t21_sundry = " t21_sundry " next sundry=" sundry exit 1 } else { # save TIMS calls sundry t21_sundry = sundry print " t21_sundry = " t21_sundry } if ( platinv_batch != "VRTBATCHFILENAME" ) { # save TIMS calls platinv_batch t21_platinv_batch[platinv_batch] = 1 print " t21 platinv_batch = " platinv_batch } } bmSERVTYPE = "" sedescextra = "" if ( SEID == 101043 ) { # t21 calls bmSERVTYPE = 1 sedescextra = "Calls" # SERVTYPE = bmSERVTYPE # # change desc to that of tbs # #SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = SEIDdesc # SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = servtypedesc } if ( SEID == 101030 ) { # t21 switchboard calls bmSERVTYPE = SEID sedescextra = "Switchboard" # SERVTYPE = bmSERVTYPE # # use SEID for SERVTYPE # #SERVTYPE = 1.1 # #SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = SEIDdesc # SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = servtypedesc " - Switchboard" } if ( SEID == 101047 ) { # t21 voicemail calls bmSERVTYPE = SEID sedescextra = "Voicemail" # SERVTYPE = bmSERVTYPE # # use SEID for SERVTYPE # #SERVTYPE = 1.2 # #SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = SEIDdesc # SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = servtypedesc " - Voicemail" } if ( SEID == 101044 ) { # mobile bmSERVTYPE = 10 #sedescextra = "Mobile" # SERVTYPE = bmSERVTYPE # # change desc to that of tbs # #SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = SEIDdesc # SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = servtypedesc } sundryEGGRID_to_tascode_arr[sundry "|" tbsSID] = tascode sundryEGGRID_to_invoiceno_arr[sundry "|" tbsSID] = invoiceno if ( SID_to_sundry_arr[tbsSID] != "" && SID_to_sundry_arr[tbsSID] != sundry ) print "LDCDEWARN: SID_to_sundry_arr[" tbsSID "]=[" SID_to_sundry_arr[tbsSID] "] set but not to sundry=[" sundry "]" else SID_to_sundry_arr[tbsSID] = sundry if ( SID_to_tascode_arr[tbsSID] != "" && SID_to_tascode_arr[tbsSID] != tascode ) print "LSCDEWARN: SID_to_tascode_arr[" tbsSID "]=[" SID_to_tascode_arr[tbsSID] "] set but not to tascode=[" tascode "]" else SID_to_tascode_arr[tbsSID] = tascode if ( SID_to_invoiceno_arr[tbsSID] != "" && SID_to_invoiceno_arr[tbsSID] != invoiceno ) print "LDCDEWARN: SID_to_invoiceno_arr[" tbsSID "]=[" SID_to_invoiceno_arr[tbsSID] "] set but not to invoiceno=[" invoiceno "]" else SID_to_invoiceno_arr[tbsSID] = invoiceno # only doing thisSHIPTO if ( thisSHIPTO != "all" && thisSHIPTO != SHIPTO ) continue ## rjs #if ( platinv_batch == "TBSAUG2004001134" ) { # print "Warning 1 Skipping platinv_batch = " platinv_batch # continue #} # only doing this platinumbatch if (platinumBATCH != "all" && platinumBATCH != platinv_batch) continue invoiceno = parent_sundry_to_platinv_invoicenumber_arr[itag] print " itag=" itag " invoiceno = " invoiceno if ( invoiceno == "" ) { print "WARNING: NO INVOICE for shipto = " SHIPTO " and sundry = " sundry " tbsSID = " tbsSID " tascode_to_orgElementID_arr[" tascode "] = " tascode_to_orgElementID_arr[tascode] #print "WARNING: NO INVOICE for shipto = " SHIPTO " and sundry = " sundry " tbsSID = " tbsSID #platinv_batch = SHIPTO monthtag "NOINV" #parent_sundry_to_platinv_batch_arr[itag] = platinv_batch #invoiceno = SHIPTO "_" "NOINV" #parent_sundry_to_platinv_invoicenumber_arr[itag] = invoiceno continue } # flag parent / sundry in cde cde_parent_sundry_arr[itag] = 1 print "cde_parent_sundry_arr[" itag "]=[" cde_parent_sundry_arr[itag] "]" #ElementID = tascode_to_ElementID_arr[tascode] ##old tassemap SEID = tascode_to_SEID_arr[tascode] #SEID = ElementID_to_SEID_arr[ElementID] SGID = SEID_to_SGID_arr[SEID] DEPTdesc = department # rjs9 - deptid added to getcde script ## assign unique departmnent id #DEPT = DEPTdesc_to_DEPT_arr[DEPTdesc] #if ( DEPT == 0 ) { # DEPTdesc_to_DEPT_arr[DEPTdesc] = ++MAXDEPT # DEPT = MAXDEPT # DEPT_to_DEPTdesc_arr[DEPT] = DEPTdesc # #printf("NEW SHIPTO = %s DEPTdesc = (%d)%s MAXDEPT = %d\n", SHIPTO, DEPT, DEPTdesc, MAXDEPT) # pipecmd = "sort >" logdir "/" "DEPT_" batchtag ".lst" # print SHIPTO "|" DEPT "|" DEPTdesc | pipecmd #} DEPT = "DEPT" deptid DEPT_to_DEPTdesc_arr[DEPT] = DEPTdesc GROUP = grid_to_parentgroupid_arr[DEPT] if ( GROUP == "" ) { GROUP = "GRPNOTFOUNDFOR" DEPT GROUPdesc = "No Group Found for DEPT=" DEPT grid_to_grname3_arr[GROUP] = GROUPdesc grid_to_parentgroupid_arr[DEPT] = GROUP grid_to_parentgroupid_arr[GROUP] = "VRT" } tbsCENTREID = "CENTRE" tbscentreid ## use invoicedeatil desc for service typ desc #if ( platinv_particular != "" ) { # print " using platinv_particular=[" platinv_particular "]" " (sundry = " sundry ")" # servtypedesc = SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] # print " to replace SERVTYPE=" SERVTYPE " desc = [" servtypedesc "]" # SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = platinv_particular # if ( ++replaced_servdesc_count_arr[SERVTYPE] > 1 ) { # print " was already replaced" # } #} ## use batchtype desc for service typ desc ##SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = batchtypedesc #if ( batchtypedesc != "" ) { # print " using batchtypedesc=[" batchtypedesc "]" " (sundry = " sundry ")" # servtypedesc = SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] # print " to replace SERVTYPE=" SERVTYPE " desc = [" servtypedesc "]" # SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = batchtypedesc # if ( ++replaced_servdesc_count_arr[SERVTYPE] > 1 ) { # print " was already replaced" # } #} #batchtypeinfo = "(" batchtypeid ": " batchtypedesc ")" #print " from batchtype [" batchtypeinfo "]" #reportgroupinfo = "(" reportgroupid ": " reportgroupdesc ": " reportorder ")" #print " from reportgroup [" reportgroupinfo "]" platinv_particular = sundry_to_particular[sundry] #SERVTYPE = SEID #SERVTYPE = batchtypeid if ( bmSERVTYPE != "" ) { print " isbm" SERVTYPE = bmSERVTYPE } else { print " notbm" SERVTYPE = batchtypeid + 3000000 } if ( SERVTYPE == 10 ) { servtypedesc = SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] } else { if ( batchtypedesc != "" ) servtypedesc = batchtypedesc else servtypedesc = SEIDdesc if ( sedescextra != "" ) servtypedesc = servtypedesc " - " sedescextra SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] = servtypedesc } print " SERVTYPE_to_SERVTYPEdesc_arr[" SERVTYPE "]=[" SERVTYPE_to_SERVTYPEdesc_arr[SERVTYPE] "]" debuginfo = "RptGrpID:" reportgroupid debuginfo = debuginfo "(" supplier ";" invoiceno ";" sundry ")" debuginfo = debuginfo " " "(SEIDdesc:" SEIDdesc ";INVDETdesc:" platinv_particular ")" debuginfo = debuginfo " " "[SERVTYPE:" SERVTYPE "(" (bmSERVTYPE != "" ? "isbm" : "notbm") "):" servtypedesc ";SEID:" orgSEID ";EID:" orgElementID "]" print " debuginfo = " debuginfo #servtypedesc = servtypedesc " " debuginfo # moved from ld_t21groups() CENTRE = DEPT PROJECT = tbsCENTREID # for t21 calls etc grid_to_ccp_arr[tbsSID] = tbscentre grid_to_centre_arr[tbsSID] = CENTRE grid_to_project_arr[tbsSID] = PROJECT print "grid_to_centre_arr[" tbsSID "] = [" grid_to_centre_arr[tbsSID] "]" print "grid_to_project_arr[" tbsSID "] = [" grid_to_project_arr[tbsSID] "]" CENTRE_to_ShipTo_arr[CENTRE] = SHIPTO CENTREPROJECT_to_ShipTo_arr[CENTRE "|" PROJECT] = SHIPTO print "CENTREPROJECT_to_ShipTo_arr[" CENTRE "|" PROJECT "] = [" CENTREPROJECT_to_ShipTo_arr[CENTRE "|" PROJECT] "]" CENTREPROJECTSID_to_EGRID_arr[CENTRE "|" PROJECT "|" tbsSID] = tbsSID print "CENTREPROJECTSID_to_EGRID_arr[" CENTRE "|" PROJECT "|" tbsSID "] = [" CENTREPROJECTSID_to_EGRID_arr[CENTRE "|" PROJECT "|" tbsSID] "]" #-rjs9 # deptid lookup (used to get deptid fronm t21 dir entries) itag = SHIPTO "|" tbsSID # rjs. 22/11/2007 #if ( parentSID_to_DEPT_arr[itag] != "" && parentSID_to_DEPT_arr[itag] != DEPT ) { # # rjs skip multiple # if ( tbsSID == "INV 2253177" ) # continue # if ( tbsSID == "INV 2257030" ) # continue # printf("FATAL ERROR: tbsSID=[%s] has multile deptid's for parent = %s\n", tbsSID, SHIPTO) # exit 1 #} parentSID_to_DEPT_arr[itag] = DEPT #------------------------ # chech values for building HIERIDx if (SERVTYPE == "" || SHIPTO == "" || GROUP == "" || CENTRE == "" || PROJECT == "" || SGID == "" || SEID == "" || DEPT == "" || tbsCENTREID == "" || tbsSID == "" || supplier == "" || tascode == "" || sundry == "" || invoiceno == "") { print "FATAL ERROR: BAD for set_HIERIDx() (1 or more blank fields)" print " SERVTYPE = " SERVTYPE print " SHIPTO = " SHIPTO print " GROUP = " GROUP print " CENTRE = " CENTRE print " PROJECT = " PROJECT print " SGID = " SGID print " SEID = " SEID " (ElementID = " ElementID ")" print " DEPT = " DEPT print " tbsCENTREID = " tbsCENTREID print " tbsSID = " tbsSID print " supplier = " supplier print " tascode = " tascode print " location = " location print " user = " user print " costcentre = " costcentre print " sundry = " sundry print " invoiceno = " invoiceno exit 1 } got_cde_data = 1 #------------------------ if ( Testing > 1 ) { print "do ld_cde()" print " SERVTYPE = " SERVTYPE print " SHIPTO = " SHIPTO print " CENTRE = " CENTRE print " PROJECT = " PROJECT print " SGID = " SGID print " SEID = " SEID " (ElementID = " ElementID ")" print " DEPT = " DEPT print " tbsCENTREID = " tbsCENTREID print " tbsSID = " tbsSID print " supplier = " supplier print " tascode = " tascode print " location = " location print " user = " user print " costcentre = " costcentre print " sundry = " sundry print " invoiceno = " invoiceno } rec_type = "T_CHARGE_SUM" # use tascode / servicedesc for chg_cat to show on distid pie chg_cat = tascode " " servicedesc SSGCPStag = SERVTYPE "|" SHIPTO "|" GROUP "|" CENTRE "|" PROJECT "|" tbsSID SSGCPS_to_tascode_arr[SSGCPStag] = tascode SSGCPS_to_location_arr[SSGCPStag] = location SSGCPS_to_user_arr[SSGCPStag] = user SSGCPS_to_costcentre_arr[SSGCPStag] = costcentre SSGCPS_to_reportgroupid_arr[SSGCPStag] = reportgroupid SSGCPS_to_reportgroupdesc_arr[SSGCPStag] = reportgroupdesc SSGCPS_to_reportorder_arr[SSGCPStag] = reportorder SSGCPS_to_SEID_arr[SSGCPStag] = SEID SSGCPS_to_debuginfo_arr[SSGCPStag] = debuginfo # # # # # called also in ldt21detail code # # set_HIERIDx("cde", SERVTYPE,CENTRE,PROJECT,supplier,invoiceno,sundry,tbsSID,rec_type,chg_cat) # # print "HIERIDx = " HIERIDx # # #rjs9 # #HIERID = SHIPTO "|" SGID "|" SEID "|" DEPT "|" tbsSID # #HIERID = HIERID "|" supplier "|" tascode "|" location "|" user "|" costcentre # #HIERID = HIERID "|" sundry # #HIERID = HIERID "|" invoiceno # # #HIERIDxDUPcount = ++HIERIDxcount[HIERID] # #HIERID = HIERID "|" HIERIDxDUPcount # #HIERIDx = HIERID "|" # # #HIERIDx_to_sundry_arr[HIERIDx] = sundry # # #HIERIDx_to_supplier_arr[HIERIDx] = supplier # #HIERIDx_to_tascode_arr[HIERIDx] = tascode # #HIERIDx_to_location_arr[HIERIDx] = location # #HIERIDx_to_user_arr[HIERIDx] = user # #HIERIDx_to_costcentre_arr[HIERIDx] = costcentre # # HIERIDx_to_rentcost_arr[HIERIDx] = rentcost # HIERIDx_to_callcost_arr[HIERIDx] = callcost # HIERIDx_to_othercost_arr[HIERIDx] = othercost # HIERIDx_to_admincost_arr[HIERIDx] = admincost # HIERIDx_to_totalcost_arr[HIERIDx] = totalcost # # chg_count = 0 # chg_duration = 0 # chg_cost = totalcost # # # don't add up cde data for these # # as this is done by dodet code # doadd = 1 # #if ( bmSERVTYPE == 1 ) # t21 calls # # doadd = 0 # #if ( bmSERVTYPE == 101030 ) # t21 switchboard # # doadd = 0 # #if ( bmSERVTYPE == 101047 ) # t21 voicemail # # doadd = 0 # #if ( bmSERVTYPE == 101044 ) # mobile # # doadd = 0 # if ( doadd == 1 ) # add_totals("TOTALTBS", SERVTYPE, GROUP, CENTRE, PROJECT, tbsSID, supplier, invoiceno, sundry, rec_type, chg_cat, chg_count, chg_duration, chg_cost) # # pipecmd = "sort -u >" logdir "/" "sundrys_" batchtag ".uniq" # print sundry " " supplier | pipecmd # # pipecmd = "sort | uniq -d >" logdir "/" "SID_" batchtag ".dup" # print tbsSID | pipecmd } close(cdefile) } function is_t21_platinv_batch(platinvbatchfilename) { for ( t21batchfilename in t21_platinv_batch ) { if ( platinvbatchfilename == t21batchfilename ) return 1 } return 0 } function ld_platinv(platinvfile) { printf("ld_platinv(%s)\n", platinvfile) while ( (getline platinvline < platinvfile) > 0 ) { split(platinvline, platinvarr, "|"); #printf("platinvline=%s\n", platinvline); f = 0 tblInvoiceShipToCode = trim(platinvarr[++f]) tblInvoicePlatinumFileName = trim(platinvarr[++f]) tblInvoicePlatinumInvoiceNo = trim(platinvarr[++f]) tblTransactionBatchID = trim(platinvarr[++f]) tblSupplierSupplierName = trim(platinvarr[++f]) tblInvoiceDetailElementID = trim(platinvarr[++f]) tblElementDesciption = trim(platinvarr[++f]) tblInvoiceDetailPeriod = trim(platinvarr[++f]) tblTransactionInvoiceDetailID = trim(platinvarr[++f]) tblInvoiceInvoiceDate = trim(platinvarr[++f]) tblInvoiceDetailDescription = trim(platinvarr[++f]) tblElementReportGroupID = trim(platinvarr[++f]) tblInvoiceDetailAmount = trim(platinvarr[++f]) #----------------------------- tblInvoiceShipToCode = toupper(tblInvoiceShipToCode) platinv_parent = tblInvoiceShipToCode platinv_batch = tblInvoicePlatinumFileName platinv_invoicenumber = tblInvoicePlatinumInvoiceNo platinv_sundry = tblTransactionBatchID platinv_supplier = tblSupplierSupplierName platinv_elementid = tblInvoiceDetailElementID platinv_reportgroupid = tblElementReportGroupID platinv_particular = tblInvoiceDetailDescription if ( platinv_parent == "" ) { print "FATAL ERROR: Blank parent (ShipTo) in platinum invoice data" exit 1 } if ( platinv_batch == "" ) { print "FATAL ERROR: Blank PlatinumFileName in platinum invoice data" exit 1 } if ( platinv_invoicenumber == "" ) { print "FATAL ERROR: Blank InvoiceNumber in platinum invoice data" exit 1 } if ( platinv_sundry == "" ) { print "FATAL ERROR: Blank Sundry (var1) in platinum invoice data" exit 1 } if ( platinv_particular == "" ) { print "FATAL ERROR: Blank particular (Detail Description) in platinum invoice data" exit 1 } print "" print " platinv_batch = " platinv_batch print "platinv_invoicenumber = " platinv_invoicenumber print " platinv_sundry = " platinv_sundry print " platinv_elementid = " platinv_elementid print " platinv_supplier = " platinv_supplier print " platinv_parent = " platinv_parent print " platinv_particular = " platinv_particulay #if (length(inp_platinumBATCH) > 0 ) { # if (length(inp_platinumBATCH) >= 7 && length(inp_platinumBATCH) <= 10) { # if ( inp_platinumBATCH != platinv_invoicenumber ) { # print " skipping invoicenumber" # continue # } # } # if (length(inp_platinumBATCH) > 10) { # if ( inp_platinumBATCH != platinv_batch ) { # print " skipping batch" # continue # } # } #} sundry_to_particular[platinv_sundry] = platinv_particular htag = platinv_parent "|" platinv_invoicenumber "|" platinv_sundry printf(" htag = [%s]\n", htag) #itag = platinv_parent "|" platinv_sundry itag = platinv_parent "|" platinv_sundry "|" platinv_elementid printf(" itag = [%s]\n", itag) jtag = platinv_parent "|" platinv_invoicenumber printf(" jtag = [%s]\n", jtag) ## rjs #if ( platinv_batch == "TBSAUG2004001134" ) { # print "Warning 0 Skipping platinv_batch = " platinv_batch # continue #} billingPeriod = tblInvoiceDetailPeriod parent_invoicenumber_sundry_to_period_arr[htag] = billingPeriod print " parent_invoicenumber_sundry_to_period_arr[" htag "] = " parent_invoicenumber_sundry_to_period_arr[htag] ## rjs 18/8/2008 if ( parent_sundry_to_platinv_batch_arr[itag] != "" && parent_sundry_to_platinv_batch_arr[itag] != platinv_batch ) { print "FATAL ERROR: conflicting platinum invoice batch / sundry" print " platinv_parent = " platinv_parent print " platinv_batch = " platinv_batch print "platinv_invoicenumber = " platinv_invoicenumber print " platinv_sundry = " platinv_sundry print " itag = " itag print " parent_sundry_to_platinv_batch_arr[" itag "] = " parent_sundry_to_platinv_batch_arr[itag] exit 1 } if ( parent_sundry_to_platinv_batch_arr[itag] == "" ) parent_sundry_to_platinv_batch_arr[itag] = platinv_batch print " parent_sundry_to_platinv_batch_arr[" itag "] = " parent_sundry_to_platinv_batch_arr[itag] ## rjs 18/8/2008 if ( parent_sundry_to_platinv_invoicenumber_arr[itag] != "" && parent_sundry_to_platinv_invoicenumber_arr[itag] != platinv_invoicenumber ) { print "FATAL ERROR: conflicting platinum invoice number / sundry" print " platinv_parent = " platinv_parent print " platinv_batch = " platinv_batch print "platinv_invoicenumber = " platinv_invoicenumber print " platinv_sundry = " platinv_sundry print " itag = " itag print " parent_sundry_to_platinv_invoicenumber_arr[" itag "] = " parent_sundry_to_platinvinvoicenumber_arr[itag] exit 1 } if ( parent_sundry_to_platinv_invoicenumber_arr[itag] == "" ) parent_sundry_to_platinv_invoicenumber_arr[itag] = platinv_invoicenumber print " parent_sundry_to_platinv_invoicenumber_arr[" itag "] = " parent_sundry_to_platinv_invoicenumber_arr[itag] if ( parent_invoicenumber_to_platinv_batch_arr[jtag] != "" && parent_invoicenumber_to_platinv_batch_arr[jtag] != platinv_batch ) { print "FATAL ERROR: conflicting platinum invoice batch / invoicenumber" print " platinv_parent = " platinv_parent print " platinv_batch = " platinv_batch print "platinv_invoicenumber = " platinv_invoicenumber print " platinv_sundry = " platinv_sundry print " jtag = " jtag print " parent_invoicenumber_to_platinv_batch_arr[" jtag "] = " parent_invoicenumber_to_platinv_batch_arr[jtag] exit 1 } parent_invoicenumber_to_platinv_batch_arr[jtag] = platinv_batch print " parent_invoicenumber_to_platinv_batch_arr[" jtag "] = " parent_invoicenumber_to_platinv_batch_arr[jtag] # flag parent / sundry in platinv platinv_parent_sundry_arr[itag] = 1 print "platinv_parent_sundry_arr[" itag "]=[" platinv_parent_sundry_arr[itag] "]" # flag parent in platinv platinv_parent_arr[platinv_parent] = 1 } close(platinvfile); } #---------------------------------------------------------- function ld_acccodeconf(acccodeconffile) { printf("ld_acccodeconf(%s)\n", acccodeconffile) system("date") while ( (getline aline < acccodeconffile) > 0 ) { split(aline, a_arr, "|") #printf("aline=%s\n", aline) f = 0 # from gett21acccode #101|1626|VM 0 OPTION TO MOBILE 0408939653|7950002| acc_desc_siteid = clip(a_arr[++f]) acc_desc_account_code = clip(a_arr[++f]) acc_desc_account_desc = clip(a_arr[++f]) acc_grid_grid = fixforfname(clip(a_arr[++f])) if ( acc_desc_account_code == "" ) acc_desc_account_code == "Account Code" acccode = acc_desc_account_code acccode_to_siteid_arr[acccode] = acc_desc_siteid acccode_to_desc_arr[acccode] = acc_desc_account_desc acccode_to_egrid_arr[acccode] = acc_grid_grid print " acccode_to_egrid_arr[" acccode "] = " acccode_to_egrid_arr[acccode] } close(acccodeconffile) } function ld_mobconf(mobconffile) { printf("ld_mobconf(%s)\n", mobconffile) system("date") while ( (getline aline < mobconffile) > 0 ) { split(aline, a_arr, "|") #printf("aline=%s\n", aline) f = 0 ## old mobconf #carriercode = clip(a_arr[++f]) #mobile = clip(a_arr[++f]) #surname = clip(a_arr[++f]) #firstname = clip(a_arr[++f]) #directoryID = clip(a_arr[++f]) # from getSIDMAINTconf recordno = clip(a_arr[++f]) mobconf_mobile = clip(a_arr[++f]) sidmainttype = clip(a_arr[++f]) mobconf_sdate = clip(a_arr[++f]) mobconf_edate = clip(a_arr[++f]) directoryID = clip(a_arr[++f]) grid = fixforfname(clip(a_arr[++f])) datatype = clip(a_arr[++f]) serviceproviderdir = clip(a_arr[++f]) carriercode = clip(a_arr[++f]) grname1 = clip(a_arr[++f]) grname3 = fixforfname(clip(a_arr[++f])) surname = clip(a_arr[++f]) firstname = clip(a_arr[++f]) manufacturer = clip(a_arr[++f]) model = clip(a_arr[++f]) servicetype = clip(a_arr[++f]) dataplan = clip(a_arr[++f]) mobile = mobconf_mobile gsub(" ","",mobile) gsub("-","",mobile) if ( mobile == "" ) { mobile = "_blank_" print "ERROR: blank mobile in mobconf recordno = [" recordno "]" directoryID = -2 } if ( surname == "" ) surname = "_blank_" if ( firstname == "" ) firstname = "_blank_" name = surname if ( firstname != "_blank_") name = sprintf("%s %s", firstname, name) if ( directoryID == "" ) { directoryID = -1 name = "Group Assigned" } if ( mobile != "_blank_" ) { mobsid = substr(mobile,1,4) "-" substr(mobile,5) mobile_to_sid_arr[mobile] = mobsid mobile_to_mob_carriercode_arr[mobile] = carriercode mobile_to_directoryID_arr[mobile] = directoryID mobile_to_grid_arr[mobile] = grid mobile_to_manufacturer_arr[mobile] = manufacturer mobile_to_model_arr[mobile] = model mobsid_to_directoryID_arr[mobsid] = directoryID if ( mobile_to_name_arr[mobile] == "" ) mobile_to_name_arr[mobile] = name if ( mobile_to_name_arr[mobile] != name ) mobile_to_name_arr[mobile] = "Multiple" print "mobconf: mobile_to_sid_arr[" mobile "] = " mobile_to_sid_arr[mobile] print "mobconf: mobile_to_directoryID_arr[" mobile "] = " mobile_to_directoryID_arr[mobile] print "mobconf: mobile_to_grid_arr[" mobile "] = " mobile_to_grid_arr[mobile] print "mobconf: mobile_to_name_arr[" mobile "] = " mobile_to_name_arr[mobile] print "mobconf: mobile_to_manufacturer_arr[" mobile "] = " mobile_to_manufacturer_arr[mobile] print "mobconf: mobile_to_model_arr[" mobile "] = " mobile_to_model_arr[mobile] } } close(mobconffile) } function ld_chargecat(chargecatfile) { printf("ld_chargecat(%s)\n", chargecatfile) system("date") while ( (getline aline < chargecatfile) > 0 ) { split(aline, a_arr, "|") #printf("aline=%s\n", aline) f = 0 chargecatid = clip(a_arr[++f]) chargecat = clip(a_arr[++f]) importdatatypeid = clip(a_arr[++f]) carriercode = clip(a_arr[++f]) rectype = clip(a_arr[++f]) chargeclasstype = clip(a_arr[++f]) globalroaming = clip(a_arr[++f]) Ctag = carriercode "|" rectype "|" chargeclasstype carriercode_chargeclasstype_to_chargecat_arr[Ctag] = chargecat print " carriercode_chargeclasstype_to_chargecat_arr[" Ctag "] = " carriercode_chargeclasstype_to_chargecat_arr[Ctag] # global roaming flag if ( toupper(globalroaming) == "Y" ) { Ctag = carriercode "|" rectype "|" chargeclasstype gloroam_class_arr[Ctag] = 1 print " gloroam_class_arr[" Ctag "] = " gloroam_class_arr[Ctag] } } close(chargecatfile) } function ld_t21rt(t21rtfile) { printf("ld_t21rt(%s)\n", t21rtfile) system("date") while ( (getline aline < t21rtfile) > 0 ) { #print aline split(aline, a_arr, "|") f = 0 rt_siteid = clip(a_arr[++f]) rt_routeid = clip(a_arr[++f]) rt_routetype = clip(a_arr[++f]) rt_routedestination = clip(a_arr[++f]) rt_routelocalid = clip(a_arr[++f]) rt_shortholdingtime = clip(a_arr[++f]) rt_trunkid = clip(a_arr[++f]) rt_trunktype = clip(a_arr[++f]) rt_trunklocalid = clip(a_arr[++f]) rt_pulsetype = clip(a_arr[++f]) rt_trunkdesc = clip(a_arr[++f]) rt_altsiteid = clip(a_arr[++f]) rt_ovrcar1 = clip(a_arr[++f]) rt_ovrcar1siteid = clip(a_arr[++f]) rt_ovrcar1acc = clip(a_arr[++f]) rt_ovrcar2 = clip(a_arr[++f]) rt_ovrcar2siteid = clip(a_arr[++f]) rt_ovrcar2acc = clip(a_arr[++f]) rte_siteid = clip(a_arr[++f]) rte_routeid = clip(a_arr[++f]) rte_trunklocalid = clip(a_arr[++f]) rte_rt_remark = clip(a_arr[++f]) rte_exch_a_end = clip(a_arr[++f]) rte_exch_b_end = clip(a_arr[++f]) rte_rt_code = clip(a_arr[++f]) rte_tkid = clip(a_arr[++f]) rte_len_no = clip(a_arr[++f]) rte_naildn_len = clip(a_arr[++f]) rte_cct_type = clip(a_arr[++f]) rte_tk_remark = clip(a_arr[++f]) rte_tk_status = clip(a_arr[++f]) rti_siteid = clip(a_arr[++f]) rti_routeid = clip(a_arr[++f]) rti_trunklocalid = clip(a_arr[++f]) rti_ipaddr = clip(a_arr[++f]) rti_device = clip(a_arr[++f]) site_sitenm1 = clip(a_arr[++f]) rt_stripdd = rt_trunkid ROUTE = rt_siteid "_" rt_routeid ROUTE_to_ROUTEdesc_arr[ROUTE] = site_sitenm1 ": " rt_routedestination #print "ROUTE_to_ROUTEdesc_arr[" ROUTE "] = [" ROUTE_to_ROUTEdesc_arr[ROUTE] "]" ROUTE_to_SITEdesc_arr[ROUTE] = site_sitenm1 site_trunk = rt_siteid "|" rt_trunklocalid site_trunk_to_stripdd[site_trunk] = rt_stripdd site_trunk_to_ovrcar1[site_trunk] = rt_ovrcar1 site_trunk_to_ovrcar1acc[site_trunk] = rt_ovrcar1acc site_trunk_to_ovrcar2[site_trunk] = rt_ovrcar2 site_trunk_to_ovrcar2acc[site_trunk] = rt_ovrcar2acc } close(t21rtfile) } function ld_t21extranges(t21extrangesfile) { printf("ld_t21extranges(%s)\n", t21extrangesfile) system("date") id = -1 while ( (getline aline < t21extrangesfile) > 0 ) { ++id split(aline, a_arr, "|") #printf("aline=%s\n", aline) f = 0 siteid = clip(a_arr[++f]) lorange = clip(a_arr[++f]) hirange = clip(a_arr[++f]) code1 = clip(a_arr[++f]) code2 = clip(a_arr[++f]) codedesc = clip(a_arr[++f]) extrange_to_siteid_arr[lorange "|" hirange] = siteid #print "extrange_to_siteid_arr[" lorange "|" hirange "] = " siteid extrange_to_code1_arr[lorange "|" hirange "|" id] = code1 extrange_to_code2_arr[lorange "|" hirange "|" id] = code2 extrangecode1_to_code2_arr[lorange "|" hirange "|" code1 "|" id] = code2 } close(t21extrangesfile) } # ----- ld_t21dircsv( ) moved and modified to below.... function ld_t21groups4(t21groups4file) { printf("ld_t21groups4(%s)\n", t21groups4file) system("date") # loop first to look at G groups (to set grid_to_parentgroupid_arr) while ( (getline aline < t21groups4file) > 0 ) { split(aline, a_arr, "|") ##printf("aline=%s\n", aline) #printf("a_arr 1=%s 2=%s 3=%s 4=%s\n", a_arr[1], a_arr[2], a_arr[3], a_arr[4]) parentgroupid = fixforfname(clip(a_arr[1])) grid = fixforfname(clip(a_arr[2])) grtype = clip(a_arr[3]) grname1 = clip(a_arr[4]) grname2 = clip(a_arr[5]) grname3 = fixforfname(clip(a_arr[6])) #if ( parentgroupid == "" ) # parentgroupid = "NOPAR" if ( grname1 == "" ) grname1 = "BLANK" if ( grname2 == "" ) grname2 = "BLANK" if ( grname3 == "" ) grname3 = "BLANK" # look at G groups only if ( grtype != "G" ) continue printf(" G - parentgroupid = [%s] grid = [%s] grtype = [%s]", parentgroupid, grid, grtype) printf(" grname1 = [%s] grname2 = [%s] grname3 = [%s]\n", grname1, grname2, grname3) parentchild_arr[parentgroupid "|" grid] = 1 childcount_arr[parentgroupid] += 1 grid_to_parentgroupid_arr[grid] = parentgroupid print " grid_to_parentgroupid_arr[" grid "] = [" grid_to_parentgroupid_arr[grid] "]" grid_to_grtype_arr[grid] = grtype grid_to_grname1_arr[grid] = grname1 grid_to_grname2_arr[grid] = grname2 grid_to_grname3_arr[grid] = grname3 ## default CENTRE/PROJECT to grname1/00000 #CENTRE = grname1 CENTRE = parentgroupid #if ( grtype == "G" ) { if ( substr(grid,1,4) == "DEPT" ) { #rjs4 # CENTRE = grname3 CENTRE = grid CENTREdesc = grname2 CENTREdesc1 = grname1 CENTREdesc2 = grname2 CENTREdesc3 = grname3 if ( CENTRE == "" ) CENTRE = grname1 if ( CENTRE == "" ) CENTRE = grid if ( CENTREdesc == "" ) CENTREdesc = grname1 if ( CENTREdesc == "" ) CENTREdesc = grid if ( CENTREdesc3 == "" ) CENTREdesc = grname1 CENTRE_to_CENTREdesc_arr[CENTRE] = CENTREdesc CENTRE_to_CENTREdesc1_arr[CENTRE] = CENTREdesc1 CENTRE_to_CENTREdesc2_arr[CENTRE] = CENTREdesc2 CENTRE_to_CENTREdesc3_arr[CENTRE] = CENTREdesc3 print "CENTRE_to_CENTREdesc_arr[" CENTRE "] = " CENTRE_to_CENTREdesc_arr[CENTRE] } printf(" CENTRE = [%s]\n", CENTRE) #rjs9 - set in ld_cde() #grid_to_centre_arr[grid] = CENTRE #print "grid_to_centre_arr[" grid "] = [" grid_to_centre_arr[grid] "]" #------------- CCP = grname1 centre_dot_project = 0 ## default CENTRE/PROJECT to grname1/00000 #CENTRE = grname1 #PROJECT = "00000" CENTRE = parentgroupid PROJECT = grid if ( substr(grid,1,6) == "CENTRE" ) { #rjs4 CENTRE = parentgroupid PROJECT = grid CCP = grnmame3 centre_dot_project = 1 print "IS centre_dot_project" PROJECTdesc = grname2 PROJECTdesc1 = grname1 PROJECTdesc2 = grname2 PROJECTdesc3 = grname3 if ( PROJECTdesc == "" ) PROJECTdesc = grid if ( PROJECTdesc3 == "" ) PROJECTdesc3 = grname2 if ( PROJECTdesc3 == "" ) PROJECTdesc3 = grid CENTREPROJECT_to_PROJECTdesc_arr[CENTRE "|" PROJECT] = PROJECTdesc CENTREPROJECT_to_PROJECTdesc1_arr[CENTRE "|" PROJECT] = PROJECTdesc1 CENTREPROJECT_to_PROJECTdesc2_arr[CENTRE "|" PROJECT] = PROJECTdesc2 CENTREPROJECT_to_PROJECTdesc3_arr[CENTRE "|" PROJECT] = PROJECTdesc3 print "0: CENTREPROJECT_to_PROJECTdesc_arr[" CENTRE "|" PROJECT "] = " CENTREPROJECT_to_PROJECTdesc_arr[CENTRE "|" PROJECT] #CENTRE_to_GGRID_arr[CENTRE] = parentgroupid CENTRE_to_GGRID_arr[CENTRE] = CENTRE print "CENTRE_to_GGRID_arr[" CENTRE "] = " CENTRE_to_GGRID_arr[CENTRE] # rjs9 centre|project has multiple egrids # see ld_cde/ldt21detail which sets CENTREPROJECTSID_to_EGRID_arr #CENTREPROJECT_to_EGRID_arr[CENTRE "|" PROJECT] = grid #print "CENTREPROJECT_to_EGRID_arr[" CENTRE "|" PROJECT "] = " CENTREPROJECT_to_EGRID_arr[CENTRE "|" PROJECT] is_CENTRE_dot_PROJECT_arr[grid] = centre_dot_project } printf(" CENTRE = [%s] PROJECT = [%s]\n", CENTRE, PROJECT) #rjs9 - set in ld_cde() #grid_to_ccp_arr[grid] = CCP #grid_to_centre_arr[grid] = CENTRE #grid_to_project_arr[grid] = PROJECT #print "grid_to_centre_arr[" grid "] = [" grid_to_centre_arr[grid] "]" #print "grid_to_project_arr[" grid "] = [" grid_to_project_arr[grid] "]" } close(t21groups4file) # now look at non G groups to handle service while ( (getline aline < t21groups4file) > 0 ) { split(aline, a_arr, "|") ##printf("aline=%s\n", aline) #printf("a_arr 1=%s 2=%s 3=%s 4=%s\n", a_arr[1], a_arr[2], a_arr[3], a_arr[4]) parentgroupid = fixforfname(clip(a_arr[1])) grid = fixforfname(clip(a_arr[2])) grtype = clip(a_arr[3]) grname1 = clip(a_arr[4]) grname2 = clip(a_arr[5]) grname3 = fixforfname(clip(a_arr[6])) #if ( parentgroupid == "" ) # parentgroupid = "NOPAR" if ( grname1 == "" ) grname1 = "BLANK" if ( grname2 == "" ) grname2 = "BLANK" if ( grname3 == "" ) grname3 = "BLANK" # look at non G groups only if ( grtype == "G" ) continue printf(" nonG - parentgroupid = [%s] grid = [%s] grtype = [%s]", parentgroupid, grid, grtype) printf(" grname1 = [%s] grname2 = [%s] grname3 = [%s]\n", grname1, grname2, grname3) parentchild_arr[parentgroupid "|" grid] = 1 childcount_arr[parentgroupid] += 1 grid_to_parentgroupid_arr[grid] = parentgroupid print " grid_to_parentgroupid_arr[" grid "] = [" grid_to_parentgroupid_arr[grid] "]" grid_to_grtype_arr[grid] = grtype grid_to_grname1_arr[grid] = grname1 grid_to_grname2_arr[grid] = grname2 grid_to_grname3_arr[grid] = grname3 #rjs9 - set in ld_cde() #grid_to_ccp_arr[grid] = CCP #grid_to_centre_arr[grid] = CENTRE #grid_to_project_arr[grid] = PROJECT #print "grid_to_centre_arr[" grid "] = [" grid_to_centre_arr[grid] "]" #print "grid_to_project_arr[" grid "] = [" grid_to_project_arr[grid] "]" } close(t21groups3file) # create entry for Unallocated Mobiles desc = "Unallocated Mobiles" grid = "UN_MOB" parentgroupid = "UNA" CENTRE = parentgroupid PROJECT = grid grid_to_grtype_arr[grid] = "E" grid_to_centre_arr[grid] = CENTRE grid_to_project_arr[grid] = PROJECT grid_to_ccp_arr[grid] = desc grid_to_grname1_arr[grid] = desc grid_to_grname2_arr[grid] = desc grid_to_grname3_arr[grid] = desc grid_to_parentgroupid_arr[grid] = parentgroupid #CENTRE_to_CENTREdesc_arr[CENTRE] = desc #CENTRE_to_CENTREdesc1_arr[CENTRE] = desc #CENTRE_to_CENTREdesc2_arr[CENTRE] = desc #CENTRE_to_CENTREdesc3_arr[CENTRE] = desc CENTREPROJECT_to_PROJECTdesc_arr[CENTRE "|" PROJECT] = desc CENTREPROJECT_to_PROJECTdesc1_arr[CENTRE "|" PROJECT] = desc CENTREPROJECT_to_PROJECTdesc2_arr[CENTRE "|" PROJECT] = desc CENTREPROJECT_to_PROJECTdesc3_arr[CENTRE "|" PROJECT] = desc CENTRE_to_GGRID_arr[CENTRE] = parentgroupid # rjs9 centre|project has multiple egrids # see ld_cde/ldt21detiail which sets CENTREPROJECTSID_to_EGRID_arr #CENTREPROJECT_to_EGRID_arr[CENTRE "|" PROJECT] = grid is_CENTRE_dot_PROJECT_arr[grid] = 0 is_TENANT_arr[grid] = 0 } function ld_t21WBDL(t21WBDLfile) { printf("ld_t21WBDL(%s)\n", t21WBDLfile) system("date") while ( (getline aline < t21WBDLfile) > 0 ) { split(aline, a_arr, "|") printf("aline=%s\n", aline) #printf("a_arr 1=%s 2=%s 3=%s 4=%s\n", a_arr[1], a_arr[2], a_arr[3], a_arr[4]) f = 0 # rjs9 wbdconf_recordno = clip(a_arr[++f]) wbdconf_distid = clip(a_arr[++f]) wbdconf_distiddesc = clip(a_arr[++f]) wbdconf_lastdist = clip(a_arr[++f]) wbdconf_lastdistdate = clip(a_arr[++f]) wbdconf_altemail = clip(a_arr[++f]) wbdconf_altemailyn = clip(a_arr[++f]) wbdconf_wbd_method = clip(a_arr[++f]) wbdconf_wbd_type = clip(a_arr[++f]) #rjs 9 (email no FORCE UPPER case) #wbdconf_userid = toupper(clip(a_arr[++f])) wbdconf_userid = clip(a_arr[++f]) wbdconf_passwd = clip(a_arr[++f]) wbdconf_sdate = clip(a_arr[++f]) wbdconf_edate = clip(a_arr[++f]) wbdlist_grid = fixforfname(clip(a_arr[++f])) dc_email = clip(a_arr[++f]) if ( wbdconf_distid == "" ) { printf("FATAL ERROR: blank wbdconf_distid aline=[%s]\n", aline) exit 1 } DISTID = wbdconf_distid # Testing if ( Testing >= 3 && ! (DISTID == "1001" || DISTID == "1002" || DISTID == "1003" || (DISTID >= "2000" && DISTID <= "2005") || DISTID == "2009" || DISTID == "2032" || DISTID == "2043") ) { #print "DISTID #TESTING... SKIP DISTID = " DISTID continue } # skip PERSONAL type (used for passwords only) # virtual personal list entries will be created by # create_virtual_user_dist_lists() if ( wbdconf_wbd_type == "PERSONAL" ) { continue; } dirID = "Person" wbdconf_recordno directoryID_to_distid_arr[dirID] = wbdconf_distid distid_to_directoryID_arr[wbdconf_distid] = dirID distid_to_distiddesc_arr[wbdconf_distid] = wbdconf_distiddesc t21name = recordno_to_t21name_arr[dirID] distid_to_t21name_arr[wbdconf_distid] = t21name distid_to_userid_arr[wbdconf_distid] = wbdconf_userid if ( distid_to_userid_arr[wbdconf_distid] == "" ) { staffid = recordno_to_staffid_arr[dirID] distid_to_userid_arr[wbdconf_distid] = staffid } distid_to_wbd_method_arr[wbdconf_distid] = wbdconf_wbd_method distid_to_wbd_type_arr[wbdconf_distid] = wbdconf_wbd_type print "distid_to_wbd_type_arr[" wbdconf_distid "]=[" distid_to_wbd_type_arr[wbdconf_distid] "]" distgrid = wbdconf_distid "|" wbdlist_grid distgrid_arr[distgrid] = 1 print "distid_to_t21name_arr[" wbdconf_distid "]=[" distid_to_t21name_arr[wbdconf_distid] "]" print "distid_to_userid_arr[" wbdconf_distid "]=[" distid_to_userid_arr[wbdconf_distid] "]" ############### # create virual management distribution lists mng_distid = "mng" wbdconf_distid mng_distiddesc = "Management Reports" mng_wbd_type = "MANAGEMENT" virtual_management_distid_arr[mng_distid] = wbdconf_distid distid_to_directoryID_arr[mng_distid] = dirID distid_to_distiddesc_arr[mng_distid] = mng_distiddesc distid_to_t21name_arr[mng_distid] = t21name distid_to_userid_arr[mng_distid] = wbdconf_userid if ( distid_to_userid_arr[mng_distid] == "" ) { staffid = recordno_to_staffid_arr[dirID] distid_to_userid_arr[mng_distid] = staffid } distid_to_wbd_method_arr[mng_distid] = wbdconf_wbd_method distid_to_wbd_type_arr[mng_distid] = mng_wbd_type distgrid = mng_distid "|" wbdlist_grid distgrid_arr[distgrid] = 1 } close(t21WBDLfile) } function ld_t21wbdexclude(t21wbdexcludefile) { printf("ld_t21wbdexclude(%s)\n", t21wbdexcludefile) system("date") while ( (getline aline < t21wbdexcludefile) > 0 ) { split(aline, a_arr, "|") printf("aline=%s\n", aline) #printf("a_arr 1=%s 2=%s 3=%s 4=%s\n", a_arr[1], a_arr[2], a_arr[3], a_arr[4]) f = 0 wbdexclude_servicetypeid = clip(a_arr[++f]) wbdexclude_siteid = clip(a_arr[++f]) wbdexclude_grid = fixforfname(clip(a_arr[++f])) wbdexclude_extnlo = clip(a_arr[++f]) wbdexclude_extnhi = clip(a_arr[++f]) exclude_arr[wbdexclude_servicetypeid "|" wbdexclude_siteid "|" wbdexclude_grid "|" wbdexclude_extnlo "|" wbdexclude_extnhi] = 1 } close(t21wbdexcludefile) } function ld_exwebconf(exwebconffile) { printf("ld_exwebconf(%s)\n", exwebconffile) system("date") #noddsupfile = "noddsup.txt" #while ( (getline custline < noddsupfile) > 0 ) { # split(custline, noddsupgggrid, " ") # noddsuparr[noddsupgggrid[1]] = 1 #} #close(noddsupfile) while ( (getline exwebconfline < exwebconffile) > 0 ) { split(exwebconfline, exwebconfarr, ",") #printf("exwebconfline=%s\n", exwebconfline) #printf("exwebconfarr 1=%s 2=%s 3=%s 4=%s\n", exwebconfarr[1], exwebconfarr[2], exwebconfarr[3], exwebconfarr[4]) exwebconf_parent = exwebconfarr[1] exwebconf_dialxx = exwebconfarr[2] exwebconf_email = exwebconfarr[3] exwebconf_emailyn = exwebconfarr[4] exwebconf_status1 = exwebconfarr[5] exwebconf_lastemailed = exwebconfarr[6] exwebconf_lastemaileddate = exwebconfarr[7] exwebconf_print = exwebconfarr[8] exwebconf_cdgroup = exwebconfarr[9] # flag parent in exwebconf exwebconf_parent_arr[exwebconf_parent] = 1 #printf("noddsuparr[%s] = %d\n", exwebconf_parent, noddsuparr[exwebconf_parent]) if ( toupper(exwebconf_dialxx) == "Y" ) noddsuparr[exwebconf_parent] = 0 else noddsuparr[exwebconf_parent] = 1 #tmpgggrid = exwebconf_parent #if ( noddsuparr[tmpgggrid] == 1 ) # printf(" NO DD SUPPRESS\n") #else # printf(" DO DD SUPPRESS\n") } close(exwebconffile) } #---------------------------------------------------------- function ld_t21callcallserviceids(t21callsfile,seid) { printf("ld_t21callserviceids(%s) seid=%s\n",t21callsfile,seid) while ( (getline cdrline < t21callsfile) > 0 ) { split(cdrline, cdr_arr, ",") ##printf("cdrline=%s\n", cdrline) gggrid = fixforfname(cdr_arr[1]) eggrid = fixforfname(cdr_arr[2]) t21egrid_to_seid_arr[eggrid] = seid } close(t21callsfile) print "finished ld_t21callserviceids()" } function ld_t21swbcallsserviceids(t21swbcallsfile,seid) { printf("ld_t21swbcallserviceids(%s) seid=%s\n",t21callsfile,seid) while ( (getline aline < t21swbcallsfile) > 0 ) { split(aline, a_arr, ",") f = 0 swb_shipto = a_arr[++f] swb_eggrid = a_arr[++f] t21egrid_to_seid_arr["SW" swb_eggrid] = seid } close(t21swbcallsfile) print "finished ld_t21swbcallserviceids()" } function ld_t21vmlcallsserviceids(t21vmlcallsfile,seid) { printf("ld_t21vmlcallserviceids(%s) seid=%s\n",t21callsfile,seid) while ( (getline aline < t21vmlcallsfile) > 0 ) { split(aline, a_arr, ",") f = 0 vml_shipto = a_arr[++f] vml_eggrid = a_arr[++f] t21egrid_to_seid_arr["VM" vml_eggrid] = seid } close(t21vmlcallsfile) print "finished ld_t21vmlcallserviceids()" } #ZZZZZZZZZZZZZZZZ #---------------------------------------------------------- #---------------------------------------------------------- #---------------------------------------------------------- #---------------------------------------------------------- #---------------------------------------------------------- #---------------------------------------------------------- #---------------------------------------------------------- #---------------------------------------------------------- ############################################################## function ld_t21dircsvfile(t21dircsvfile) { printf("ld_t21dircsvfile(%s)\n", t21dircsvfile) system("date") t21dirreccnt = -1 while ( (getline aline < t21dircsvfile) > 0 ) { ++t21dirreccnt split(aline, a_arr, ",") printf("aline=%s\n", aline) #printf("a_arr 1=%s 2=%s 3=%s 4=%s 5=%s\n", a_arr[1], a_arr[2], a_arr[3], a_arr[4], a_arr[5]) f = 0 recordno = trim(a_arr[++f]) t21surname = trim(a_arr[++f]) t21firstname = trim(a_arr[++f]) extn = clip(a_arr[++f]) t21site = clip(a_arr[++f]) t21section = clip(a_arr[++f]) t21divsion = clip(a_arr[++f]) t21title = clip(a_arr[++f]) t21location = trim(a_arr[++f]) extgroupunique = fixforfname(clip(a_arr[++f])) email = clip(a_arr[++f]) tec = clip(a_arr[++f]) t21mobile = clip(a_arr[++f]) fax = clip(a_arr[++f]) voicemail = clip(a_arr[++f]) t21department = grid_to_grname1_arr[extgroupunique] staffid = "D" recordno master = "Y" # for mk_dircsvfile() print " recordno = [" recordno "]" recordno_to_aline_arr[recordno] = aline print " recordno_to_aline_arr[" recordno "] = [" recordno_to_aline_arr[recordno] "]" t21dirreccnt_to_recordno_arr[t21dirreccnt] = recordno print " t21dirreccnt_to_recordno_arr[" t21dirreccnt "] = [" t21dirreccnt_to_recordno_arr[t21dirreccnt] "]" recordno_to_master_arr[recordno] = master print " recordno_to_master_arr[" recordno "] = [" recordno_to_master_arr[recordno] "]" if ( t21surname == "" ) t21surname = "_blank_" if ( t21firstname == "" ) t21firstname = "_blank_" if ( t21location == "" ) t21location = "_blank_" gsub(" ","",t21mobile) gsub("-","",t21mobile) printf(" - extgroupunique = [%s] extn = [%s]\n", extgroupunique, extn) printf(" t21surname = [%s] t21firstname = [%s]\n", t21surname, t21firstname) printf(" t21site = [%s] t21location = [%s]\n", t21site, t21location) printf(" t21division = [%s]\n", t21division) printf(" t21department = [%s]\n", t21department) t21name = t21surname if ( t21firstname != "_blank_") t21name = sprintf("%s %s", t21firstname, t21name) recordno_to_t21name_arr[recordno] = t21name print " recordno_to_t21name_arr[" recordno "] = [" recordno_to_t21name_arr[recordno] "]" recordno_to_staffid_arr[recordno] = staffid print " recordno_to_staffid_arr[" recordno "] = [" recordno_to_staffid_arr[recordno] "]" recordno_to_extn_arr[recordno] = extn recordno_to_eggrid_arr[recordno] = extgroupunique recordno_to_t21site_arr[recordno] = t21site recordno_to_t21location_arr[recordno] = t21location # newbb1 BBBBBBB code1 = get_code1(extn) print "code1=[" code1 "]" " extn=[" extn "]" if ( code1 != "" ) { if ( egrid_to_code1[extgroupunique] != "" && egrid_to_code1[extgroupunique] != code1 ) print "ld_t21dircsv() extgroupunique=" extgroupunique " code1=" code1 " already has egrid_to_code1[" extgroupunique "] set to [" egrid_to_code1[extgroupunique] "]" else egrid_to_code1[extgroupunique] = code1 print "egrid_to_code1[" extgroupunique "]=[" egrid_to_code1[extgroupunique] "]" } code2 = nget_code2(extn,code1) print "code2=[" code2 "]" " extn=[" extn "]" # can't do this (code2 is NOT unique within extn group) #if ( code2 != "" ) { # if ( egrid_to_code2[extgroupunique] != "" && egrid_to_code2[extgroupunique] != code2 ) # print "ld_t21dircsv() extgroupunique=" extgroupunique " code2=" code2 " already has egrid_to_code2[" extgroupunique "] set to [" egrid_to_code2[extgroupunique] "]" # else # egrid_to_code2[extgroupunique] = code2 # print "egrid_to_code2[" extgroupunique "]=[" egrid_to_code2[extgroupunique] "]" #} recordno_to_t21surname_arr[recordno] = t21surname recordno_to_t21firstname_arr[recordno] = t21firstname recordno_to_t21division_arr[recordno] = t21division recordno_to_t21department_arr[recordno] = t21department_college print " recordno_to_extn_arr[" recordno "] = [" recordno_to_extn_arr[recordno] "]" print " recordno_to_eggrid_arr[" recordno "] = [" recordno_to_eggrid_arr[recordno] "]" #itag = extgroupunique "|" extn itag = extn printf(" itag = [%s]\n", itag) if ( master == "Y" ) { if ( dirextn_to_recordno_arr[itag] == "" ) dirextn_to_recordno_arr[itag] = recordno if ( dirextn_to_t21name_arr[itag] == "" ) dirextn_to_t21name_arr[itag] = t21name if ( dirextn_to_t21name_arr[itag] != t21name ) dirextn_to_t21name_arr[itag] = "Multiple" print " dirextn_to_t21name_arr[" itag "] = [" dirextn_to_t21name_arr[itag] "]" if ( dirextn_to_t21surname_arr[itag] == "" ) dirextn_to_t21surname_arr[itag] = t21surname if ( dirextn_to_t21surname_arr[itag] != t21surname ) dirextn_to_t21surname_arr[itag] = "Multiple" if ( dirextn_to_t21firstname_arr[itag] == "" ) dirextn_to_t21firstname_arr[itag] = t21firstname if ( dirextn_to_t21firstname_arr[itag] != t21firstname ) dirextn_to_t21firstname_arr[itag] = "Multiple" if ( dirextn_to_t21site_arr[itag] == "" ) dirextn_to_t21site_arr[itag] = t21site if ( dirextn_to_t21site_arr[itag] != t21site ) dirextn_to_t21site_arr[itag] = "Multiple" if ( dirextn_to_t21location_arr[itag] == "" ) dirextn_to_t21location_arr[itag] = t21location if ( dirextn_to_t21location_arr[itag] != t21location ) dirextn_to_t21location_arr[itag] = "Multiple" if ( dirextn_to_t21division_arr[itag] == "" ) dirextn_to_t21division_arr[itag] = t21division if ( dirextn_to_t21division_arr[itag] != t21division ) dirextn_to_t21division_arr[itag] = "Multiple" if ( dirextn_to_t21department_arr[itag] == "" ) dirextn_to_t21department_arr[itag] = t21department if ( dirextn_to_t21department_arr[itag] != t21department ) dirextn_to_t21department_arr[itag] = "Multiple" dirextn_to_eggrid_arr[itag] = extgroupunique } if ( egrid_to_t21site_arr[extgroupunique] == "" ) egrid_to_t21site_arr[extgroupunique] = t21site if ( egrid_to_t21site_arr[extgroupunique] != t21site ) egrid_to_t21site_arr[extgroupunique] = "Multiple" extn_to_egridlist_arr[extn] = extn_to_egridlist_arr[extn] "|" extgroupunique if ( t21surname == ".INDIAL" ) { indial_nbr = gsub("X","[0-9]",telephone) indial_arr[telephone] = t21site print " indial_arr[" telephone "] = [" indial_arr[telephone] "]" } } close(t21dircsvfile) } #ZZZZZZZZZZZZZZZZ #---------------------------------------------------------- #---------------------------------------------------------- ############################################################## function spit_dircsv() { print " do spit_dircsv() out_recordno=[" out_recordno "]" # from ecu #printf("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n", # recordno, t21surname, t21firstname, out_extn, out_t21mobile, # t21mobile_carrier, out_centre, out_project, out_ccpdesc, # t21title, t21site, t21location) >>dircsvfile_fname # from wb3 ostr = sprintf("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", out_recordno, out_name, out_extn, out_div, out_divdesc, out_group, out_groupdesc, out_deptid, out_sectdept, out_project, out_projectdesc, out_seid, out_seiddesc, out_sid, out_mobile, out_sundry, out_supplier, out_invoiceno, out_location, out_title, out_email, out_tec, out_fax, out_voicemail, out_replinkflag) print ostr >>dircsvfile_fname } function split_dir_aline(aline) { if ( aline == "" ) { #print "WARNING: split_dir_aline BLANK aline DISTID = " DISTID tmprecno = 0 t21surname = "" t21firstname = "" extn = "" t21site = "" t21section = "" t21divsion = "" t21title = "" t21location = "" extgroupunique = "" email = "" tec = "" t21mobile = "" fax = "" voicemail = "" mobsid = "" staffid = "D" recordno master = "Y" return } split(aline, a_arr, ",") ##printf("aline=%s\n", aline) #printf("a_arr 1=%s 2=%s 3=%s 4=%s 5=%s\n", a_arr[1], a_arr[2], a_arr[3], a_arr[4], a_arr[5]) f = 0 tmprecono = trim(a_arr[++f]) t21surname = trim(a_arr[++f]) t21firstname = trim(a_arr[++f]) extn = trim(a_arr[++f]) t21site = trim(a_arr[++f]) t21section = trim(a_arr[++f]) t21divsion = trim(a_arr[++f]) t21title = trim(a_arr[++f]) t21location = trim(a_arr[++f]) extgroupunique = trim(a_arr[++f]) email = trim(a_arr[++f]) tec = trim(a_arr[++f]) t21mobile = trim(a_arr[++f]) fax = trim(a_arr[++f]) voicemail = trim(a_arr[++f]) t21name = t21firstname if ( t21name != "" && t21surname != "" ) t21name = t21name " " t21name = t21name t21surname staffid = "D" recordno master = "Y" } function set_dircsv_recinfo(recno, extngroupid) { out_recordno = recno # bilmax21 centre / project bmcentre = grid_to_centre_arr[extngroupid] bmproject = grid_to_project_arr[extngroupid] # VT group out_group = grid_to_parentgroupid_arr[bmcentre] out_groupdesc = grid_to_grname3_arr[out_group] # VT centre out_project = bmproject out_projectdesc = CENTREPROJECT_to_PROJECTdesc3_arr[bmcentre "|" bmproject] # rjs9 #out_ccpdesc = CENTREPROJECT_to_PROJECTdesc_arr[bmcentre "|" bmproject] out_ccpdesc = "" #--- from wb3 ------------- out_div = t21division out_name = t21name out_extn = extn out_divdesc = ShipTo_to_ShipToDesc_arr[out_div] # VT department #out_deptid = parentSID_to_DEPTID_arr[out_div "|" extngroupid] out_deptid = bmcentre out_sectdept = t21section vtdepartment = CENTRE_to_CENTREdesc_arr[bmcentre] if (out_sectdept != "" && vtdepartment != "" ) out_sectdept = out_sectdept " " out_sectdept = out_sectdept vtdepartment # why is this in wb3 # if ( out_div == "VRT" ) # out_seid = 101043 out_seid = seid out_seiddesc = SEID_to_SEIDdesc_arr[out_seid] out_sid = extngroupid tmp_mobile = t21mobile gsub(" ","",tmp_mobile) gsub("-","",tmp_mobile) if ( length(tmp_mobile) == 10 ) mobsid = substr(tmp_mobile,1,4) "-" substr(tmp_mobile,5,6) else mobsid = tmp_mobile out_mobile = mobsid out_sundry = sundry out_supplier = supplier out_invoiceno = invoiceno #elementid = tascode_to_ElementID_arr[tascode] elementid = SEID_to_orgElementID_arr[seid] out_elementid = elementid out_title = t21title out_location = t21location # why is this in wb3 # # if not doing TLM - skip TLM dir entries # if ( this_divgroup != "TLM" && t21div == "TLM" ) # continue out_email = email out_tec = tec out_fax = fax out_voicemail = voicemail out_replinkflag = replinkflag # why ? # if not real extn then clear these if ( out_extn == 0 ) { out_sundry = "" out_supplier = "" out_invoiceno = "" out_replinkflag = 0 } #< from wb3 ---------------- } function spit_dircsv_if_in_distid(recno, extngroupid) { print "spit_dircsv_if_in_distid(" recno "," extngroupid" )" # test if dir entry belongs to a grid in distlist for ( dgstr in distgrid_arr ) { split(dgstr, dgstr_arr, "|") #print " check dgstr_arr[1]=[" dgstr_arr[1] "]" if ( DISTID != dgstr_arr[1] ) continue #print " test dgstr_arr[2]=[" dgstr_arr[2] "]" distgrid = dgstr_arr[2] distservtype = dgstr_arr[3] if ( distservtype != "" ) { # only this servtype distsid = dgstr_arr[4] incl = 0 if ( distsid != "" ) { # only this sid if (distservtype == "1" && distsid == extn) { print " SINGLE extn dgstr = " dgstr incl = 1 } if (distservtype == "10" && distsid == mobsid) { print " SINGLE mobile dgstr = " dgstr incl = 1 } } else { incl = 1 } if ( incl ) { set_dircsv_recinfo(recno, distgrid) spit_dircsv() } continue } #print " test extngroupid=" extngroupid " belongs to distgrid=" distgrid if (test_grid1_belongs_to_grid2(extngroupid, distgrid)) { set_dircsv_recinfo(recno, extngroupid) spit_dircsv() break } } } function mk_dircsvfile() { printf("mk_dircsvfile() DISTID = %s\n", DISTID) system("date") dircsvfile_fname = sprintf("topdat/%s/%s/data/direnq/T21E_%s.csv", monthdir, DISTID, DISTID) print " dircsvfile_fname=[" dircsvfile_fname "]" #if ( virtual_management_distid_arr[DISTID] != "" ) { # # vmng # ## dircsv file is sym link for virtual management lists # #real_distid = virtual_management_distid_arr[DISTID] # #real_dircsvfile_fname = sprintf("../../../%s/data/direnq/T21E_%s.csv", real_distid, real_distid) # #cmd = "ln -s \"" real_dircsvfile_fname "\" \"" dircsvfile_fname "\"" # #print "virtual management distid dircsv symlink [" cmd "]" # #system(cmd) # return #} newdir = sprintf("topdat/%s/%s/data/direnq", monthdir, DISTID) cmd = sprintf("[ ! -d \"%s\" ] && mkdir -p \"%s\"", newdir, newdir) system(cmd) add_fname_to_fnamelist(dircsvfile_fname) maxrecordno = 1 print "" print "doing t21dir t21dirreccnt=" t21dirreccnt " ..." for ( reccnt = 0; reccnt <= t21dirreccnt; ++reccnt ) { recordno = t21dirreccnt_to_recordno_arr[reccnt] # get largest recordno if ( (0 + recordno) > maxrecordno ) maxrecordno = recordno aline = recordno_to_aline_arr[recordno] #print " t21dirreccnt_to_recordno_arr[" reccnt "] = [" t21dirreccnt_to_recordno_arr[reccnt] "]" #print " recordno = [" recordno "]" " aline = [" aline "]" if ( aline == "" ) { print "WARNING: skipping BLANK aline DISTID = " DISTID " reccnt=[" reccnt "]" " recordno=[" recordno "]" continue } split_dir_aline(aline) if ( reccnt == 0 ) { # header # -------- based on wb3 ------------- out_recordno = recordno out_name = "}1Name/User/Description______________" out_extn = "#}eXtension" out_div = "^1ShipTo" out_divdesc = "^1Customer_Name____________" out_group = "^1GroupID___" out_groupdesc = "^1Group_________________________" out_deptid = "^1#DeptID____" # BM CENTRE out_sectdept = "^1}Section/Department______________________" out_project = "^2Project___" # VT CentreID out_projectdesc = "^2Centre____" # VT Centre ##ccpdesc = "^2Centre_Project_Description______________" #out_ccpdesc = "^2Description_____________________________" out_seid = "^2#SEID__" out_seiddesc = "^2}BatchType_____________________" out_sid = "^2}ServiceID________________" out_mobile = "^2}Mobile______" out_sundry = "^2}Sundry" out_supplier = "^2}Supplier____________" out_invoiceno = "^2}InvoiceNo_" out_location = "^3Location________________________________" out_title = "^3Title_________________________" out_email = "^3Email_________________________________" out_tec = "^4TEC______" out_fax = "^4#Fax_Number__" out_voicemail = "^4Voicemail_" out_replinkflag = "^4#RepLinkFlag" #< wb3 ------------- spit_dircsv() continue } # is a PERSONAL virtual distid # only has one user entry Vdistid_directoryID = Vdistid_to_directoryID_arr[DISTID] if ( Vdistid_directoryID != "" ) { print " mk_dircsv PERSONAL Vdistid = DISTID" print " Vdistid_directoryID = [" Vdistid_directoryID "]" aline = recordno_to_aline_arr[Vdistid_directoryID] #print " aline = [" aline "]" split_dir_aline(aline) sundry = "" supplier = "" invoiceno = "" # only have services belonging to distid replinkflag = 1 set_dircsv_recinfo(recordno, extgroupunique) spit_dircsv() break } # configured distid directory contains all entries # belonging to the distribution list ## skip non master #if ( recordno_to_master_arr[recordno] != "Y" ) { # continue #} pgrid = grid_to_parentgroupid_arr[extgroupunique] if ( pgrid == "SPARE" || pgrid == "UNPROG" ) # skip continue sundry = "" supplier = "" invoiceno = "" # only have services belonging to distid replinkflag = 1 spit_dircsv_if_in_distid(recordno, extgroupunique) } #close(dircsvfile_fname) print "" print "doing cde..." #- from wb3 --------- # add cde data for this distid for ( HIERIDxorder = 1; HIERIDxorder <= HIERIDxmaxorder; ++HIERIDxorder ) { HIERIDx = HIERIDxorder_to_HIERIDx_arr[HIERIDxorder] get_HIERIDx_info(HIERIDx, 2) # skip if not from cde data if ( HIERIDxfrom != "cde" ) continue recordno = ++maxrecordno t21surname = "" t21firstname = user t21name = t21firstname extn = "Service:" t21site = "" t21section = "" t21division = DIVID t21title = "" t21location = location extgroupunique = SID email = "" tec = "" t21mobile = "" fax = "" voicemail = "" staffid = "D" recordno master = "N" seid = SEID # skip (already got this from the t21 directory) ## t21 calls and rent rest VRT #if ( seid == 1043 || seid == 2399 ) { # seid now set here in ld_cde() if ( seid == 101043 ) { print "skipping t21 eggrid SID = [" SID "]" extn = "Service:-" #continue } ## mobile rest VRT #if ( seid == 1044 || seid == 2405 ) { # seid now set here in ld_cde() if ( seid == 101044 ) { # skip cde if mobile in t21 directory tmp_mobile = SID gsub(" ","",tmp_mobile) gsub("-","",tmp_mobile) print "test t21mobile_to_egridextn_arr[" tmp_mobile "] = [" t21mobile_to_egridextn_arr[tmp_mobile] "]" if (t21mobile_to_egridextn_arr[tmp_mobile] != "") { print "skipping mobile = [" SID "]" extn = "Service:--" #continue } t21mobile = SID } else { t21mobile = "" } if ( SEID == 101047 ) voicemail = "VOICEMAIL" else voicemail = "" sundry = SUNDRY supplier = SUPPLIER invoiceno = INVOICENO # only have services belonging to distid replinkflag = 1 spit_dircsv_if_in_distid(recordno, extgroupunique) } #< from wb3 ---------------------- close(dircsvfile_fname) } #-------------------------------------------- #-------------------------------------------- BEGIN { print "tdir.awk" print " MMYYYY=[" MMYYYY "]" print " sdate=[" sdate "]" print " edate=[" edate "]" print " logdir=[" logdir "]" print " dot21verify=[" dot21verify "]" print " retroBDL=[" retroBDL "]" print " thisDISTID=[" thisDISTID "]" print " thisCENTRE=[" thisCENTRE "]" print " platinumBATCH=[" platinumBATCH "]" print " t21groups4file=[" t21groups4file "]" print " t21dircsvfile=[" t21dircsvfile "]" if ( logdir == "" ) logdir = "./" Testing = 0 testmobdet = 0 LinkUserHTMLindex = 0 # set bill period vars MMYYYY_to_billperiod(MMYYYY,"_") YYYYMM = substr(MMYYYY,3,4) substr(MMYYYY,1,2) TBSBillingPeriod = substr(MMYYYY,3,4) "/" substr(MMYYYY,1,2) YYYY = 0 + substr(YYYYMM,1,4) MM = 0 + substr(YYYYMM,5,2) rfmtexbillperiod = sprintf("%04d-%02d", YYYY, MM) print "Begin wb4 - dot21verify=" dot21verify " thisCENTRE=" thisCENTRE #rjs9 print " - RESTcde = " RESTcde print " - platinumBATCH = " platinumBATCH print " - switchboardcallcost = " switchboardcallcost print " - voicemailcallcost = " voicemailcallcost print " - MMYYYY = " MMYYYY print " - billperiod = " billperiod print " - YYYYMM = " YYYYMM if ( thisSHIPTO == "" ) { thisSHIPTO = "all" } if ( platinumBATCH == "" ) { platinumBATCH = "all" } batchtag = thisCENTRE monthdir = monthtag printf("monthdir = %s\n", monthdir) #------------------------ # load mobile conf data ld_mobconf(mobconffile) #------------------------ # load chargecat data ld_chargecat(chargecatfile) #------------------------ # load t21 route trunk data ld_t21rt(t21rtfile) #------------------------ # load t21 extranges data ld_t21extranges(t21extrangesfile) #------------------------ # load t21 groups data ld_t21groups4(t21groups4file) #------------------------ # load t21 directory data ld_t21dircsvfile(t21dircsvfile) print "t21dirreccnt=" t21dirreccnt grid_to_parentgroupid_arr["XXX"] = "ZZZ" grid_to_grtype_arr["XXX"] = "G" grid_to_grname1_arr["XXX"] = "XXX Group Not Found" grid_to_grname2_arr["XXX"] = "XXX Group Not Found" grid_to_grname3_arr["XXX"] = "XXX Group Not Found" grid_to_ccp_arr["XXX"] = "XXXXX.XXXXX" grid_to_centre_arr["XXX"] = "XXXXX" grid_to_project_arr["XXX"] = "XXXXX" childcount_arr["XXX"] = 1 grid_to_parentgroupid_arr["YYY"] = "XXX" grid_to_grtype_arr["YYY"] = "E" grid_to_grname1_arr["YYY"] = "YYY Group Not Found" grid_to_grname2_arr["YYY"] = "YYY Group Not Found" grid_to_grname3_arr["YYY"] = "YYY Group Not Found" grid_to_ccp_arr["YYY"] = "YYYYY.YYYYY" grid_to_centre_arr["YYY"] = "YYYYY" grid_to_project_arr["YYY"] = "YYYYY" #----------------------------------------------------- # setup service type desc array SERVTYPE_to_SERVTYPEdesc_arr["All"] = "All Batch Types" st = 10 SERVTYPE_to_GLcode_arr[st] = 0 SERVTYPE_to_SERVTYPEdesc_arr[st] = "Mobile Calls and Charges" if ( SERVTYPE_to_GLcode_arr[st] != 0 ) SERVTYPE_to_SERVTYPEdesc_arr[st] = SERVTYPE_to_SERVTYPEdesc_arr[st] " (" SERVTYPE_to_GLcode_arr[st] ")" mobdummy_cost = 0 st = 5 SERVTYPE_to_GLcode_arr[st] = 0 SERVTYPE_to_SERVTYPEdesc_arr[st] = "Account Code Charges" if ( SERVTYPE_to_GLcode_arr[st] != 0 ) SERVTYPE_to_SERVTYPEdesc_arr[st] = SERVTYPE_to_SERVTYPEdesc_arr[st] " (" SERVTYPE_to_GLcode_arr[st] ")" st = 4 SERVTYPE_to_GLcode_arr[st] = 0 SERVTYPE_to_SERVTYPEdesc_arr[st] = "Overhead Charges" if ( SERVTYPE_to_GLcode_arr[st] != 0 ) SERVTYPE_to_SERVTYPEdesc_arr[st] = SERVTYPE_to_SERVTYPEdesc_arr[st] " (" SERVTYPE_to_GLcode_arr[st] ")" st = 3 SERVTYPE_to_GLcode_arr[st] = 0 SERVTYPE_to_SERVTYPEdesc_arr[st] = "Miscellaneous Charges" if ( SERVTYPE_to_GLcode_arr[st] != 0 ) SERVTYPE_to_SERVTYPEdesc_arr[st] = SERVTYPE_to_SERVTYPEdesc_arr[st] " (" SERVTYPE_to_GLcode_arr[st] ")" st = 2 SERVTYPE_to_GLcode_arr[st] = 0 SERVTYPE_to_SERVTYPEdesc_arr[st] = "Equipment and Service Charges" #SERVTYPE_to_SERVTYPEdesc_arr[st] = SERVTYPE_to_SERVTYPEdesc_arr[st] "EXTNCNT" if ( SERVTYPE_to_GLcode_arr[st] != 0 ) SERVTYPE_to_SERVTYPEdesc_arr[st] = SERVTYPE_to_SERVTYPEdesc_arr[st] " (" SERVTYPE_to_GLcode_arr[st] ")" st = 1 SERVTYPE_to_GLcode_arr[st] = 0 SERVTYPE_to_SERVTYPEdesc_arr[1] = "Fixed Line Call Charges" if ( SERVTYPE_to_GLcode_arr[st] != 0 ) SERVTYPE_to_SERVTYPEdesc_arr[st] = SERVTYPE_to_SERVTYPEdesc_arr[st] " (" SERVTYPE_to_GLcode_arr[st] ")" #----------------------------------------------------- # tims fixed call categories fixed_callcat_to_chg_cat["J"] = "Fixed Originating Internal" fixed_callcat_to_chg_cat["A"] = "Fixed Answering Internal" fixed_callcat_to_chg_cat["L"] = "Fixed To Local" fixed_callcat_to_chg_cat["M"] = "Fixed To Mobile" fixed_callcat_to_chg_cat["E"] = "Fixed To Information" fixed_callcat_to_chg_cat["S"] = "Fixed To STD" fixed_callcat_to_chg_cat["I"] = "Fixed To IDD" fixed_callcat_to_chg_cat["N"] = "Fixed Incoming Network" fixed_callcat_to_chg_cat["P"] = "Fixed Incoming Public" fixed_callcat_to_chg_cat["O"] = "Fixed Outgoing Network" fixed_callcat_to_chg_cat["F"] = "Fixed Free" fixed_callcat_to_chg_cat["X"] = "Fixed From Directory" #----------------------------------------------------------------- #rjs9 # tbsdata database ld_tbsdata_customer(tbsCustomerfile) ld_tbsdata_servicetype(tbsServiceTypefile) ld_tbsdata_element(tbsElementfile) ld_tbsdata_supplier(tbsSupplierfile) ld_tbsdata_person(tbsPersonfile) #----------------------------- # tbs person service list data ld_tbsdata_personservicelist(tbsPersonServiceListfile) # rjs9 ## to translate VRT seid for drill down #ld_seidtranslate("indata/" monthtag "/seidtranslate.csv") #----------------------------------------------------------------- # load t21 Web Billing Distribution Lists ld_t21WBDL(t21WBDLfile) #------------------------ # load t21 Web Billing Distribution site/grid/extn Eclusion List ld_t21wbdexclude(t21wbdexcludefile) #------------------------------------------------ HIERIDx = "" print "--------------------------------" if ( retroBDL != "1" ) HIERIDxfile = "HIERIDx_" batchtag "_lst.rtf" else HIERIDxfile = "HIERIDx_" batchtag "_rlst.rtf" print "HIERIDxfile=[" HIERIDxfile "]" print "get processing order from sorted HIERIDx file" print "and generate distid totals" HIERIDxorder = 0 while ( (getline HIERIDx < HIERIDxfile) > 0 ) { HIERIDxorder_to_HIERIDx_arr[++HIERIDxorder] = HIERIDx #print HIERIDxorder " HIERIDx = " HIERIDx } close(HIERIDxfile) HIERIDxmaxorder = HIERIDxorder print "HIERIDxmaxorder = " HIERIDxmaxorder print "--------------------------------" #################################################################### #----------------------------------------------------------------- # load exwebconffile - get groups with NO dialled digit suppression ld_exwebconf(exwebconffile) #----------------------------------------------------------------- # create t21 serviceid list from t21 call files # ld_t21callcallserviceids(t21callsfile, 101043) # ld_t21swbcallsserviceids(t21swcallsfile, 101030) # ld_t21vmlcallsserviceids(t21vmcallsfile, 101047) #------------------------ got_cde_data = 0 ld_cde(cdefile) # if ( !dot21verify ) { # # create egrid distid list array # create_egrid_distidlist() # } #----------------------------------------------------- print "--------------------------------" print "starting create..." # create dircsv for selected user DISTID = thisDISTID mk_dircsvfile() print "done." exit(0) }