Bilmax21 wb4 (tqnew doex4-3bweb 2nd Phase TBS data access). # flat unloads gettbs tCustomer $tbsCustomerfile gettbs tServiceType $tbsServiceTypefile gettbs tElement $tbsElementfile gettbs tSupplier $tbsSupplierfile # get mobile user config (calls gettbspersonservicelist) gettbsmobconf "$mobconffile" # get hierarchy from tbs transaction data gettbstransactionhierarchy "$SDATE" "$EDATE" ' #gettbs tPerson $tbsPersonfile copytPerson "$tbsPersonfile" # get tbs person serverice list gettbspersonservicelist $tbsPersonServiceListfile # get invoice pdfs from file share (calls getinvpdf) getallinvpdf "$billperiod" "$invpdfdir" # Main work is... # get invoice and CDE data from TBSdata getinvcdedetail6 "$SDATE" "$EDATE" "$platinvfile" "$cdefile" "$tdetailodir" "$splitby" "$mimportcsvdir" # # uses the beloow SQL to get a list of PERIOD's to run # each of the following.. #getinv6, getcde6, getdetail6, getmcsv6 for each PERIOD # # SELECT DISTINCT Period # FROM tInvoice, tInvoiceDetail # where tInvoiceDetail.InvoiceID = tInvoice.ID # and tInvoice.InvoiceDate > # dateadd($IOFFSETDAYS,'$EYYYYMMDD') # and tInvoice.InvoiceDate <= # dateadd(mm,1,dateadd(dd,$IOFFSETDAYS,'$EYYYYMMDD')) # $EXCLUDEINVBIT # $EXCLUDEBATCHIDBIT # ORDER BY Period # Also calls get gettbsswbrate to get cost for Switchboard calls # SQL in gettbsswbrate is.. # select cost from tRate # where ServiceTypeID = 1024 # and Active = 1