============ Ajeet =========
--Parle Setup
https://drive.google.com/drive/folders/1HfFqZguv0jaqPdxjng6MQz2mcdSuEwIW
https://drive.google.com/drive/folders/1F-Uq0BKX1hAyzQix-dgancLBh9oK2yVA?usp=sharing
-- Databaselink-
New-- https://drive.google.com/file/d/1hWefKqfUTAmwTxGs2VGpMb2tdmOwUwxs/view?usp=sharing
Old-- https://drive.google.com/file/d/11B-fCOUey2mpdulaYtLqnsgLIE7ko5P0/view?usp=sharing
-- SQL 2014
https://drive.google.com/drive/folders/1ksQY6m7VN-9c4nIN9IBfmQKCQSErF-23?usp=sharing
--Autodeployment
Truncate table Setupdetails
Truncate table import_Deploy_filenames
Truncate table deployexenames
delete from WSMasterExportUploadTrack where ProcessName<> 'sales details'
select * from Retailer where RtrCode='Dummy'
select * from RouteMaster--2-1S00041137
select * from salesman
select * from SalesmanmarketDummyRoute
---- Database login after software open
User:- Parleadmin
Password:- Adm!nP@rleL3
truncate table defendrestore
--Login Issue on new rollout site
CREATE TABLE [dbo].[Menu_Status_Track](
[Menu_Type] [int] NULL,
[Table_Name] [varchar](100) NULL,
[Updated_Date] [datetime] NULL
) ON [PRIMARY]
--Sync Path Update
update Configuration set Condition = 'http://Sehyog.parle.biz/PRLLive/' where ModuleId = 'DATATRANSFER31'
update Configuration set Condition = 'http://Sehyog.parle.biz/ParleIntegrationNew/POS2Console.asmx' where ModuleId = 'DATATRANSFER44'
update Configuration set Condition = 'http://Sehyog.parle.biz/ParleIntegrationNew/Console2POS.asmx' where ModuleId = 'DATATRANSFER45'
--Backup Path change
UPDATE A SET A.Condition='E:\AutoBackUp_Differntial\' FROM DATABASEBACKUPCONFIGURATION A WHERE ModuleId='AUTOBACKUP_DIFF10'
UPDATE A SET A.Condition='E:\AutoBackUp_Differntial\Processed\' FROM DATABASEBACKUPCONFIGURATION A WHERE ModuleId='AUTOBACKUP_DIFF18'
GO
--(Script update)
http://sehyog.parle.biz/PRLLive/
--SFA Intrigration
UPDATE Tbl_syncConfiguration SET Setting =1 Where ProcessName In('PDAExecuteAfterSync','PDASuccessMsgShow')
UPDATE Tbl_SFAConfiguration SET CValue ='https://xdintegration.vxceed.net/IntegrationService.svc?wsdl' Where CName ='WebserviceURL'
--- Db recover script
dbcc checkdb ( run for check db is corrupted or not if does not run than take backup of database right click on database => task -backup
See the path of the file on which place store the file than other script)
Replace sehyog with database name and run one query one time fourth line important.
EXEC sp_resetstatus 'SEHYOG';
ALTER DATABASE SEHYOG SET EMERGENCY WITH ROLLBACK IMMEDIATE
ALTER DATABASE SEHYOG SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('SEHYOG', REPAIR_ALLOW_DATA_LOSS) with no_infomsgs
ALTER DATABASE SEHYOG SET MULTI_USER
== Sync not complete 77% stop stock transfer validating
update counters set zpad='7' where Prefix='STM' and TabName='StockManagement'
--- Sync id update
select * from SyncStatus
update SyncStatus set SyncId= '138' where SyncId= '137'
select * from sync_master order by 1 desc
update sync_master set syncid='138' where SyncId='137'
select * from synccounter
update SyncCounter set CurrValue='138'
UPDATE table_name
SET column1 = value1, column2 = value2, ...
[WHERE condition];
---- Mobile All table -
select * from Tbl_WSDownloadIntegration
select * from Import_WS2CS_SalesOrderDetail (sales panel order details)
select * from Tbl_WSDownloadIntegration
select * from Import_WS2CS_SalesOrderDetail
select * from Import_WS2CS_SalesOrderHeader_Track where routecode= '1-1S00027724' order by DocumentDate desc
delete from WSMasterExportUploadTrack
------- All maintables
select * from Tbl_DownloadIntegration (all tables download data from console)
select * from Tbl_UploadIntegration (all tables upload data core stock from console)
select * from Tbl_WSDownloadIntegration ( all tables download data from mobile)
select * from Tbl_WSUploadIntegration ( all tables upload corestocky data to mobile)
---- salesman app login issuse
select HHTDeviceSerialNumber,* from salesman
update salesman set HHTDeviceSerialNumber= '1020068-2-1S00040875' where SMCode= '2-1S00040875'
select * from Import_WS2CS_NewCustomerRequest (table - Show new retailer)
sp_helptext PROC_Validate_WS2CS_NewCustomerRequest
select * from Retailer
SP_DEPENDS Import_WS2CS_NewCustomerRequest
select * from Configuration where condition like '%http%' (sync path check)
select * from Cn2Cs_Prk_RetailerGST_Track (retailer track check when retailer not download)
select * from cn2cs_park_retailerReDownload_track(retailer track check when retailer not download)
select * from RouteMaster
update RouteMaster set RMstatus='1' (new customer procces fail issuse)
---- Order not show in sehyog
select * from Tbl_WSDownloadIntegration
select * from Import_WS2CS_SalesOrderDetail
select * from Import_WS2CS_SalesOrderHeader_Track order by CreatedDate desc
----Table information-
EXEC sp_help 'dbo.routemaster'
EXEC sp_help 'dbo.retailer'
EXEC sp_help 'dbo.salesinvoice'
--- Retailer and sales invoice combine table query
select RT.RtrName,SI.SalGrossAmount,SI.SalInvNo,SI.OrderDate from retailer AS RT
INNER JOIN SalesInvoice AS SI
ON RT.RtrId = SI.RtrId order by 2 desc
--- Sales invoice filler
select SalGrossAmount, * from SalesInvoice where SalGrossAmount >= 10000 and SalGrossAmount <= 20000 order by 1 desc
--- Last two months' sales
select sum(SalGrossAmount) from SalesInvoice where SalInvDate >= DATEADD(MONTH,-3,'2024-03-01') AND SalInvDate <= '2024-03-01'
SELECT * FROM SalesInvoice
WHERE SalGrossAmount >= 10000
AND SalGrossAmount <= 20000
AND SalInvDate >= DATEADD(MONTH, -2, '2024-03-12')
AND SalInvDate <= '2024-03-12' order by SalInvDate desc
---- Last two months' sales with retailer name
SELECT RT.RtrName, SI.SalGrossAmount, SI.SalInvNo, SI.OrderDate
FROM retailer AS RT
INNER JOIN (
SELECT * FROM SalesInvoice
WHERE SalGrossAmount >= 10000
AND SalGrossAmount <= 20000
AND SalInvDate >= DATEADD(MONTH, -2, '2024-03-12')
AND SalInvDate <= '2024-03-12'
) AS SI ON RT.RtrId = SI.RtrId
ORDER BY SI.SalGrossAmount DESC;
--- Sync id unlock
select * from Distributor
select * from SyncStatus
select * from salesinvoice order by 1 desc
Select * from updaterlog order by 1 desc
select * from JCMonthEnd order by 3 desc
select * from DebitNoteTopSheetClaimHd order by 1 desc
select cmpinvno, InvDate from PurchaseReceipt order by 1 desc
select count(*) from SchemeMaster where SchStatus=1
select comconrefno from ContractPricingMaster order by 1 desc
----- Stock Check
select Serverdate,B.prdname,A.* from Export_CS2WS_WarehouseInventory_QS A join
Product b
on A.ItemCode=b.PrdCCode
order by 2