Table of Contents

{$page}

Explanation of SQL

These are the steps to repair the data for users with incorrect Direct Costs from Bills. The total amount of all Ledger entries for Direct Cost from Bills should always equal zero.

This repair will only make adjustment to Direct Costs entries attributed to orders and bills. If there are any manual entries, the direct costs amount still be incorrect. The user will have to make adjusting entries in this case.

Risk of Data Corruption if Run Improperly

High. Data is modified in this query. Do not run this except under the direction of a Cyrious Technical Support staff member. Doing otherwise may result in lost or contaminated data. All data modifications done through direct SQL are permanent and non-reversable.

Instructions

Make sure the user is running the most current release of Control before beginning this repair.

Download this file:

direct_costs_fix.rar

Files Included in Direct Costs Fix.rar

Steps that to executed

Here are the steps that need to be executed to repair the Direct Costs amounts.

You can use the Breakdown.sql query to monitor the progress.

Rows returns by Breakdown.sql

Please note: If you are monitoring the breakdown as the repairs are running, it is not unusual for the discrepancy to get larger as repairs are made.

  1. Execute the Repair.sql query.
  1. Run the Control in IDE mode.
  1. Execute the Prep For Refresh GL1.sql query to flag the Bills.
  1. In Control, go to Bill Explorer in Advanced Mode.
  1. Click Modify Criteria.
  1. Clear the Criteria
  1. Under Bill Criteria, add where the Memo contains !!cyrious!!
  1. Refresh the results and show all rows.
  1. Under Action, click Refresh GL on these Transactions. After it is complete, leave the Bill Explorer open, because it may be used in the future.
  1. Execute the Prep For Refresh GL2.sql query to flag the Orders not corrected by any Bills.
  1. In Control, go to Order Explorer in Advanced Mode.
  1. Click Modify Criteria.
  1. Clear the Criteria
  1. Under Order Criteria, add where the Order Notes contains !!cyrious!!
  1. Refresh the results and show all rows.
  1. Under Action, click Refresh GL on these Transactions. After it is complete, leave the Order Explorer open, because it may be used in the future.
  1. Execute Breakdown.sql, verify that “GL Amount with Transaction” is zero, if not, repeat all of these steps starting at step 1. It has been necessary to do these steps twice, but never more than that. If “GL Amount with Transaction” is still not zero after 2 times, notify someone in Development about the situation.

When the repair is complete, all of the rows of Breakdown.sql will show zero.

If the “GL Amount without Transaction” value is not zero, execute Manual Direct Cost Entries.sql and give the user the results and explain to them that they will need to make some adjustments to reverse their past adjustments.

Version Information