Sales deletion

We have a client who has entered 1000s of items and POs in a new setup. However the cashiers have been practicing sales on the same database (about

10-20) records. How can we delete these sales in the best way, so they can start fresh.

Thanks

Reply to
Meaux
Loading thread data ...

From SO Administrator .. connect to database menu database | delete transactions

antonio

p.s. remove all transactions data! please make a backup before

Reply to
Antonio Mazzeo

Reply to
Meaux

1) Do you want to delete the transactions ? (Sales) ? 2) Do you want to restore item quantity modified from sales? 3) Do you want to keep purchase order (order and inventory transfer in.. or all?) ?or to remove po ?

please reply

thank you antonio

Reply to
Antonio Mazzeo

Reply to
Meaux

it's saturday ... and I not work from two months :(

Ok, do You have in your database non standard item ? (kit, matrix...?)

It's possibly to restore item quantity directly from sales..

it's indifferent.. Depends from item type..

After you close a purchase order, RMS insert data into 'InventoryTransferLog' .. do you want to remove rows from this table?

Antonio

Reply to
Antonio Mazzeo

:( Sorry.

Almost all the items are matrix

In that case if we can restore the items quantity, its a bonus!

No. Because We still want to show that we have received these items and these items are > >

Reply to
Meaux

The query truncate all rows of sales, increment quantity of item sold and reset all counters (total visits, sales, and others)

bye antonio

p.s. please make a BACKUP before use.. I tried the query on test database, not customer db

/* QUERY */

IF EXISTS (SELECT name FROM sysobjects WHERE name = 'vwSumQuantity' AND XTYPE = 'V') DROP VIEW vwSumQuantity GO

CREATE VIEW vwSumQuantity AS SELECT ItemID, SUM(Quantity) as Quantity FROM TransactionEntry GROUP BY ItemID GO

/* Update item quantity of standard item.. the component of matrix are standard item */ UPDATE Item SET Quantity = Item.Quantity + vwSumQuantity.Quantity, LastUpdated = GETDATE(), LastSold = NULL FROM vwSumQuantity WHERE vwSumQuantity.ItemID = Item.ID AND Item.ItemType = 0 GO

DROP VIEW vwSumQuantity GO

TRUNCATE TABLE AccountReceivable TRUNCATE TABLE AccountReceivableHistory TRUNCATE TABLE Batch TRUNCATE TABLE CalendarEvent TRUNCATE TABLE DailySales TRUNCATE TABLE DropPayout TRUNCATE TABLE Import TRUNCATE TABLE ImportEntry TRUNCATE TABLE Journal TRUNCATE TABLE Message TRUNCATE TABLE NonTenderTransaction TRUNCATE TABLE OldJournal TRUNCATE TABLE [Order] TRUNCATE TABLE OrderEntry TRUNCATE TABLE OrderHistory TRUNCATE TABLE Payment TRUNCATE TABLE RecordDeletedLog TRUNCATE TABLE Shipping TRUNCATE TABLE TaxEntry TRUNCATE TABLE TaxTotals TRUNCATE TABLE TenderEntry TRUNCATE TABLE VisaNetAuthorization TRUNCATE TABLE VisaNetBatch TRUNCATE TABLE TenderTotals TRUNCATE TABLE TimeCard TRUNCATE TABLE TimeClock TRUNCATE TABLE [Transaction] TRUNCATE TABLE TransactionEntry TRUNCATE TABLE TransactionHold TRUNCATE TABLE TransactionHoldEntry TRUNCATE TABLE Voucher TRUNCATE TABLE VoucherEntry GO

UPDATE Customer SET LastClosingBalance = 0, AccountBalance = 0, TotalSales = 0, TotalVisits = 0, TotalSavings = 0 GO

UPDATE Register SET CurrentBatchNumber = 0, ZZBatchNumber = 0 GO

UPDATE Serial SET TransactionEntryID = 0 GO

Reply to
Antonio Mazzeo

Reply to
Meaux

Thank you Meaux, but It's my work (also if it's a critical period)

bye antonio

Reply to
Antonio Mazzeo

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.