JIWA Version 6.5.13 - When you update inventory classifications, the stock items classifications do not get updated unless you open the item in Inventory maintenance and save it. Below is a script that will update all stock items with the classification it is attached to. Simply run this script on the JIWA database.
/* Script to set ledger codes in IN_Main to match codes set in IN_Classification
******************************************
Select the correct database before running
******************************************
*/
DECLARE @DbaseName varchar(32)
DECLARE @UserInformation char(100)
Select @DBaseName = db_name()
print 'Dumping Transactions'
dump transaction @DBaseName with no_log
UPDATE IN_Main
SET IN_Main.LedgerInvValue = IN_Classification.LedgerInvValue ,
IN_Main.LedgerMovement_COG = IN_Classification.LedgerMovement_COG ,
IN_Main.LedgerExpAsset = IN_Classification.LedgerExpAsset ,
IN_Main.LedgerExpLiab = IN_Classification.LedgerExpLiab ,
IN_Main.LedgerDelAsset = IN_Classification.LedgerDelAsset ,
IN_Main.LedgerDelLiab = IN_Classification.LedgerDelLiab ,
IN_Main.LedgerAssignedValue = IN_Classification.LedgerAssignedValue ,
IN_Main.LedgerCogVariance = IN_Classification.LedgerCogVariance ,
IN_Main.LedgerInvSales = IN_Classification.LedgerInvSales ,
IN_Main.LedgerInvTaxDB = IN_Classification.LedgerInvTaxDB ,
IN_Main.LedgerAccumulator = IN_Classification.LedgerAccumulator ,
IN_Main.LedgerPurchases = IN_Classification.LedgerPurchases ,
IN_Main.LedgerShipComplete = IN_Classification.LedgerShipComplete ,
IN_Main.LedgerWriteOn = IN_Classification.LedgerWriteOn ,
IN_Main.LedgerWriteOff = IN_Classification.LedgerWriteOff ,
IN_Main.LedgerCostPriceAdj = IN_Classification.LedgerCostPriceAdj ,
IN_Main.LedgerDeliveredVariance = IN_Classification.LedgerDeliveredVariance ,
IN_Main.LedgerPurchInvVariance = IN_Classification.LedgerPurchInvVariance,
IN_Main.LedgerDutyVariance = IN_Classification.LedgerDutyVariance,
IN_Main.LedgerFreightVariance = IN_Classification.LedgerFreightVariance,
IN_Main.LedgerFXOnArrival = IN_Classification.LedgerFXOnArrival
FROM IN_Main, IN_Classification
WHERE IN_Classification.InventoryClassificationID = IN_Main.ClassificationID
print 'Script finished' |