1. Process Billing Maintenance
    1. Pre-Step Status
      1. Began Process Billing Maintenance
    2. Stored Procedure
      1. job_processBillingMaintenance
        1. Params
          1. rollDays Integer
          2. 0 = default
          3. Number of days in future used for dateDiff calculations
          4. debug Integer
          5. 0 = doCommits, default
          6. 1 = only produce audit trail
    3. Steps
      1. Process Collections
        1. Step Type
          1. SQL
        2. Prerequisites
          1. Already have 1 or more open transactions
          2. Customer = Active
          3. > 1 month past paidThrough date
        3. Result
          1. Billable is inactivated
          2. If no active billable, inactivate Customer
          3. Insert note that billable was cancelled due to Collections
          4. Inactivation reason = Collections
        4. Query Name
          1. ???
      2. Close Scheduled Inactivation Billable
        1. Step Type
          1. SQL
        2. Prerequisites
          1. Billable is fully paid
          2. Inactivation date prior to renewal date
        3. Result
          1. Billable is inactivated
        4. Query Name
          1. ????
      3. Process Non-Billable customers
        1. Step Type
          1. SQL
        2. Prerequisites
          1. Active Customers with no Active Billables
        3. Result
          1. Sets Customer status to inactive
          2. Calls Immediate Deactivation Processor
        4. Query Name
          1. ????
      4. Close open billable transactions on inactive customer
        1. Step Type
          1. SQL
        2. Prerequisites
          1. Customer is inactive
          2. Open transactions exist for the Customer
        3. Result
          1. Open transactions are closed for this customer
        4. Query Name
          1. ????
      5. Update open text ads for inactive customer
        1. Step Type
          1. SQL
        2. Prerequisites
          1. Customer is inactive
          2. Customer has open text ads
        3. Result
          1. Text ads are deactivated
          2. Billable for text ad is inactivated
        4. Query Name
          1. ????
      6. Update claim status to inactive
        1. Step Type
          1. SQL
        2. Prerequisites
          1. Customer is inactive
          2. Claim is active for this customer
        3. Result
          1. Claim is deactivated
          2. Note is inserted for inactivated claim
        4. Query Name
          1. ????
    4. Post Step Status
      1. Completed Process Billing Maintenance
  2. Deactivate Customers with No Active Billables
    1. Step Type
      1. Java
    2. Prerequisites
      1. Step 1
    3. Stored Procedures
      1. job_processNonBillableCustomers
        1. Returns
          1. customerId
    4. Result
      1. Customer set to Inactive
      2. Any active Sales Claim is Closed
      3. All Ads and Banners Inactivated for Customer
      4. All Billables deactivated for Customer
      5. CustomerStatusChange set to INACTIVATION
  3. Contracts missing Open Transactions
    1. Pre Step Status
      1. Began Process Contracts missing Open Transactions
    2. Step Type
      1. SQL
    3. Prerequisites
      1. Contract Billable already has Past Due Transactions
      2. At least 1 more paymentsDue remains for the contract
    4. Result
      1. Insert transaction as PastDue = 51
      2. Insert transaction Details
      3. Insert Transaction HIstory
    5. Query Name
      1. ????
    6. Post Step Status
      1. Completed Process Contracts missing Open Transactions
  4. Process Billables to Upgrade
    1. Pre Step Status
      1. Began Process Billables To Upgrade
    2. Stored Procedures
      1. job_processBillablesToUpgradeNew
        1. Returns
          1. ,new_product_id = CAST( null as int )
          2. ,new_product = CAST( null as varchar(100) )
          3. ,new_unit_price = CAST( null as money )
          4. ,new_quantity = CAST( null as int )
          5. ,new_discount = CAST( null as float )
          6. ,new_total = CAST( null as money )
          7. ,new_LegacyAdjustment = CAST(null as money)
    3. Result
      1. Promo applied, if applicable
      2. Billable Entities are replicated on new billable, including applicable features
      3. Amount is set to new webProduct amount field
      4. LegacyAdjustment is calculated where appropriate
      5. Credit Available is calculated
      6. Predecessor Billable is inactivated
      7. New Billable is created
      8. Insert Transaction with TxnStatus = 97 Pre-Processing
      9. Insert Transaction Details
      10. Insert Transaction History
    4. Post Step Status
      1. Completed Process Billables To Upgrade
  5. Process Renewals
    1. Pre Step Status
      1. Began Process Billable Renewals
    2. Steps
      1. Update Payments Remaining
        1. Prerequisites
          1. Active, 0 payments remaining
        2. Result
          1. Reset payments remaining to ....
        3. Stored Procedures
          1. job_processBillableRenewals
      2. Insert Renewal Transactions
        1. Prerequisites
          1. Active Customer with billable payments remaining > 0 and has no open transactions or doesn’t have any transactions
        2. Result
          1. Credit available is applied
          2. Customer is billed via Recurring Billing Processor
          3. Insert transaction
          4. Insert Transaction Details
          5. Insert TransactionHistory
          6. Roll paidThroughDate on Billable
        3. Stored Procedures
          1. job_getBillableCustomers
    3. Post Step Status
      1. Completed Process Renewals
  6. Generate Processor Batch
    1. Pre Step Status
      1. Began Generate Processor Batch
    2. Prerequisites
      1. Step 1 has completed successfully
        1. When debug is off, only transactions created on or before the billing date will be included
      2. If resubmitting a failed batch, the previous batch has been been marked as Complete
    3. Stored Procedure
      1. job_getProcessorBatch
        1. Result
          1. Gets any Past Due Transactions not currently in an outstanding batch = 51
          2. Gets any Pre-Processing transactions not currently in an outstanding batch = 97
          3. Returns
          4. transactionId
          5. bidclerkOrderId
          6. amount
          7. customerName
          8. line 1
          9. city
          10. state
          11. zipcode
          12. country
          13. temporaryCreditCardNumber
          14. expMMYY
          15. creditCardType
          16. tokenValue
          17. transactionTypeId (Pre-Auth, Sale, Credit)
          18. processorOrderNumber
          19. BatchId
    4. Post Step Status
      1. Completed Generate Processor Batch
  7. Create Batch FTP File
    1. Batch Status = New
    2. Named ${batchId}.asc
    3. File stored locally at ?????
    4. Batch Status = Ready
  8. FTP File to Litle
    1. target is /bdclrk/inbound/${batchId}.asc
    2. Once file is transferred, renamed to ${batchId}.proc
    3. Batch Status = In Progress
  9. Post Step Status
    1. Completed Generate Processor Batch
  10. Consume Completed Processor Batch
    1. Pre Step Status
      1. Began Consume Processor Batch
    2. Poll inbound FTP folder until ${batchId}.proc is available
      1. Not received after configured time
        1. Mark batch as Errorred
      2. Received
        1. Subtopic 1
          1. Batch Status = Complete
    3. For each transaction in the received batch
      1. stored procedure job_completeProcessorTransaction
        1. Inputs
          1. transactionId (from ID field of each LitleResponse)
          2. ,@NewTokenVal varchar(50)
          3. ,@TransactionProcessorId int=null
          4. ,@CreditCardTypeId int = null
          5. ,@ExpCCMMYYYY varchar(6) = null
          6. ,@PPDInd varchar(50) = null
          7. ,@AffType varchar(20) = null
          8. ,@CCHolderType varchar(20) = null
          9. ,@LastStatusVal varchar(50)
          10. ,@LastStatusDate datetime
          11. ,@createdBy int
          12. ,@createdOn datetime
          13. processorOrderNumber
        2. Steps
          1. Manage Token
          2. commons_manageCustomerToken
          3. Update Transaction
          4. commons_updateTransaction
          5. Roll PaidThroughDate
          6. Subtopic 1
          7. commons_rollPaidThroughForBillable
          8. Update Batch Transaction to Processed
          9. Send Email to Customer
          10. Insert Note that Email was Sent
    4. Post Step Status
      1. Completed Consume Processor Batch
  11. Collect Remaining Open Transactions where Predecessor Open Collected